gcache

package
v0.0.0-...-91d2721 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GroupELTeam               = "EL-Team"
	GroupELParticipants       = "EL-Participants"
	GroupELParticipantForTeam = "EL-Participants-For-Team"
)
View Source
const (
	InsecureToken = "INSECURE"
	TokenKey      = "Authorization"
)

Variables

View Source
var (
	ErrPendingGroupsCreated    = errors.New("pending groups already created")
	ErrPendingGroupsNotCreated = errors.New("pending groups not created yet")
	ErrNoSuchGroup             = errors.New("requested group doesn't exist")
)
View Source
var (
	ErrBadStatusCode = errors.New("bad status code returned")
)

Functions

func RegisterGroup

func RegisterGroup(g *groupcache.Group)

func RegisterPendingGroup

func RegisterPendingGroup(f GroupFunc) error

Types

type GroupFunc

type GroupFunc func(log *logrus.Entry, sgc *SharedGCache) *groupcache.Group

type GroupGetterFunc

type GroupGetterFunc func(ctx context.Context, log *logrus.Entry, sgc *SharedGCache, key string) ([]byte, error)

type SecuredHeaderTransport

type SecuredHeaderTransport struct {
	http.RoundTripper
	Token string
	Ctx   context.Context
}

func (*SecuredHeaderTransport) RoundTrip

func (ct *SecuredHeaderTransport) RoundTrip(req *http.Request) (*http.Response, error)

type SharedGCache

type SharedGCache struct {
	// contains filtered or unexported fields
}

func GlobalCache

func GlobalCache() *SharedGCache

GlobalCache fetches the main, global, shared gcache

func NewGlobalSharedGCache

func NewGlobalSharedGCache(log *logrus.Entry, rClient *redis.Client) (*SharedGCache, error)

func NewSharedGCache

func NewSharedGCache(log *logrus.Entry, rClient *redis.Client) (*SharedGCache, error)

func (*SharedGCache) FetchPeers

func (c *SharedGCache) FetchPeers() ([]string, error)

func (*SharedGCache) GetAllGroups

func (c *SharedGCache) GetAllGroups() ([]*groupcache.Group, error)

GetAllGroups returns a list of all groupcache groups

func (*SharedGCache) GetGroupByName

func (c *SharedGCache) GetGroupByName(groupName string) (*groupcache.Group, error)

func (*SharedGCache) GetPool

func (c *SharedGCache) GetPool() *groupcache.HTTPPool

GetPool returns pool to register to "/_groupcache/" web handler

func (*SharedGCache) GroupCacheHandler

func (c *SharedGCache) GroupCacheHandler(ctx *gin.Context)

GroupCacheHandler register via gin to "/_groupcache/"

func (*SharedGCache) Shutdown

func (c *SharedGCache) Shutdown() error

Shutdown our groupcache

func (*SharedGCache) StartRunPrep

func (c *SharedGCache) StartRunPrep() error

StartRunPrep handles the startup prep

Jump to

Keyboard shortcuts

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