cache

package
v4.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheType

type CacheType string

CacheType represents the type of cache backend to use.

const (
	// TypeMemory uses in-memory TTL cache (default for single instance).
	TypeMemory CacheType = "memory"

	// TypeDistributed uses database-backed distributed cache (for HA).
	TypeDistributed CacheType = "distributed"
)

type Config

type Config struct {
	Backend CacheType
	Store   store.Store
}

Config holds configuration for creating a cache service.

type MembershipService

type MembershipService interface {
	// Get returns if the user is a member of the organization.
	Get(ctx context.Context, _forge forge.Forge, u *model.User, org string) (*model.OrgPerm, error)
}

MembershipService is a service to check for user membership.

func NewDistributedMembershipService

func NewDistributedMembershipService(_store store.Store) MembershipService

NewDistributedMembershipService creates a new distributed membership service.

func NewMembershipService

func NewMembershipService(_store store.Store) MembershipService

NewMembershipService creates a new membership service.

func NewMembershipServiceWithConfig

func NewMembershipServiceWithConfig(config Config) MembershipService

NewMembershipServiceWithConfig creates a membership service based on configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL