store

package
v0.1.26 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiRegistration

type ApiRegistration interface {
	Api() api.Api
	TimeRegistered() time.Time
	UpdateTimeRegistered(time.Time)
	LifeSpan() time.Duration
	Expired(time.Time) bool
}

func NewApiRegistration

func NewApiRegistration(api api.Api, timeReged time.Time, lifeSpan time.Duration) (ApiRegistration, error)

type ApiRegistrationStore

type ApiRegistrationStore interface {
	//Attempts to add ApiRegistration. If it is already there then nothing occurs
	AddReg(ApiRegistration)
	//Get all of the apis for a given name
	GetAllRegsForName(name string) []ApiRegistration
	//Get every registration that we have stored
	GetAllRegs() []ApiRegistration
	//Remove the registration that we have for a given Api
	RemoveRegForApi(api.Api) error

	AddListener(event.RegistrationListener)
	RemoveListener(event.RegistrationListener)
}

func NewSyncApiRegistrationStore

func NewSyncApiRegistrationStore(pChan <-chan time.Time) ApiRegistrationStore

type ApiStore

type ApiStore interface {
	Add(api.Api) bool
	Contains(api.Api) bool
	All() []api.Api
	Remove(api.Api) bool
}

func NewSyncApiStore

func NewSyncApiStore() ApiStore

type RegistrationListenerStore

type RegistrationListenerStore interface {
	Add(event.RegistrationListener)
	Remove(event.RegistrationListener)
	Notify(event.RegistrationEvent)
}

func NewSyncRegistrationListenerStore

func NewSyncRegistrationListenerStore() RegistrationListenerStore

Jump to

Keyboard shortcuts

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