actionCache

package
v2.0.20 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 18 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionJob

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

func (*ActionJob) String

func (aj *ActionJob) String() string

type ActionResult

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

type Actions

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

func NewActions

func NewActions(actions map[string][]string, logger zLogger.ZLogger) *Actions

func (*Actions) Action

func (a *Actions) Action(ap *mediaserverproto.ActionParam, domain string, actionTimeout time.Duration) (*mediaserverproto.Cache, error)

func (*Actions) AddClient

func (a *Actions) AddClient(name string, client *ClientEntry)

func (*Actions) GetClient

func (a *Actions) GetClient(name string) (*ClientEntry, bool)

func (*Actions) GetParams

func (a *Actions) GetParams(_type, action, domain string) ([]string, error)

func (*Actions) IsEmpty added in v2.0.19

func (a *Actions) IsEmpty() bool

func (*Actions) RemoveClient

func (a *Actions) RemoveClient(name string) error

func (*Actions) Start added in v2.0.19

func (a *Actions) Start() error

func (*Actions) Stop added in v2.0.19

func (a *Actions) Stop() error

type Cache

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

func NewCache

func NewCache(actionTimeout time.Duration, dbs map[string]mediaserverproto.DatabaseClient, allDomains []string, logger zLogger.ZLogger) *Cache

func (*Cache) Action

func (*Cache) AddActions

func (c *Cache) AddActions(typeActionsParams TypeActionParams, domains []string) error

func (*Cache) AddClientEntry

func (c *Cache) AddClientEntry(typeActionsParams TypeActionParams, domains []string, name string, client *ClientEntry)

func (*Cache) Close added in v2.0.19

func (c *Cache) Close() error

func (*Cache) GetAction added in v2.0.20

func (c *Cache) GetAction(mediaType, action, domain string) (*Actions, bool)

func (*Cache) GetActions

func (c *Cache) GetActions(typeActions TypeAction, domains []string) (resultActions *Actions, resultOK bool)

func (*Cache) GetAllActionParam added in v2.0.7

func (c *Cache) GetAllActionParam() TypeActionParams

func (*Cache) GetClientEntry

func (c *Cache) GetClientEntry(mediaType, action, domain, address string) (*ClientEntry, bool)

func (*Cache) GetClientEntryByName added in v2.0.20

func (c *Cache) GetClientEntryByName(name string) (resultClient *ClientEntry, resultDomains []string, resultTypeActions TypeAction, rok bool)

func (*Cache) GetParams

func (c *Cache) GetParams(mediaType string, action string) ([]string, error)

func (*Cache) RemoveClientEntry added in v2.0.19

func (c *Cache) RemoveClientEntry(address string) error

func (*Cache) SetAction

func (c *Cache) SetAction(typeActionsParam TypeActionParams, domains []string, actionsObject *Actions)

type ClientEntry

type ClientEntry struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewClientEntry

func NewClientEntry(name string, client mediaserverproto.ActionClient, closer io.Closer, interval time.Duration, dbs map[string]mediaserverproto.DatabaseClient, queueSize int) *ClientEntry

func (*ClientEntry) Close

func (c *ClientEntry) Close() error

func (*ClientEntry) RefreshTimeout

func (c *ClientEntry) RefreshTimeout(interval time.Duration)

func (*ClientEntry) SetTimeout

func (c *ClientEntry) SetTimeout(expiration time.Time)

func (*ClientEntry) Start

func (c *ClientEntry) Start(workers uint32, logger zLogger.ZLogger) error

type CurrentActions added in v2.0.12

type CurrentActions struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewCurrentActions added in v2.0.12

func NewCurrentActions() *CurrentActions

func (*CurrentActions) AddAction added in v2.0.12

func (ca *CurrentActions) AddAction(id string) error

func (*CurrentActions) AddWaiter added in v2.0.12

func (ca *CurrentActions) AddWaiter(id string, ch chan<- *ActionResult) error

func (*CurrentActions) GetWaiters added in v2.0.12

func (ca *CurrentActions) GetWaiters(id string) []chan<- *ActionResult

func (*CurrentActions) HasAction added in v2.0.12

func (ca *CurrentActions) HasAction(id string) bool

func (*CurrentActions) RemoveAction added in v2.0.12

func (ca *CurrentActions) RemoveAction(id string) error

type Queue added in v2.0.19

type Queue[V any] struct {
	sync.Mutex
	Items []*V
	// contains filtered or unexported fields
}

func NewQueue added in v2.0.19

func NewQueue[V any](size int, logger zLogger.ZLogger) *Queue[V]

func (*Queue[V]) AddSize added in v2.0.19

func (q *Queue[V]) AddSize(size int)

func (*Queue[V]) Len added in v2.0.19

func (q *Queue[V]) Len() int

func (*Queue[V]) Out added in v2.0.19

func (q *Queue[V]) Out() <-chan V

func (*Queue[V]) Pop added in v2.0.19

func (q *Queue[V]) Pop() (V, bool)

func (*Queue[V]) Push added in v2.0.19

func (q *Queue[V]) Push(item V) bool

func (*Queue[V]) SetSize added in v2.0.19

func (q *Queue[V]) SetSize(size int)

func (*Queue[V]) Start added in v2.0.19

func (q *Queue[V]) Start()

func (*Queue[V]) Stop added in v2.0.19

func (q *Queue[V]) Stop()

type TypeAction added in v2.0.20

type TypeAction map[string][]string

func (TypeAction) Equals added in v2.0.20

func (ta TypeAction) Equals(ta2 TypeAction) bool

func (TypeAction) String added in v2.0.20

func (ta TypeAction) String() string

type TypeActionParams added in v2.0.20

type TypeActionParams map[string]map[string][]string

func (TypeActionParams) Equals added in v2.0.20

func (tap TypeActionParams) Equals(tap2 TypeActionParams) bool

func (TypeActionParams) GetTypeActions added in v2.0.20

func (tap TypeActionParams) GetTypeActions() TypeAction

Jump to

Keyboard shortcuts

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