Documentation
¶
Index ¶
- type ObserveState
- type ObserverGroup
- func (g *ObserverGroup) AddObserver(atState ObserveState) chan ObserveState
- func (g *ObserverGroup) AddObserverWithTimeout(atState ObserveState, timeout time.Duration) chan ObserveState
- func (g *ObserverGroup) AttachObserver(atState ObserveState, observer chan ObserveState)
- func (g *ObserverGroup) DetachObserver(observer chan ObserveState) bool
- func (g *ObserverGroup) Notify(nextState ObserveState)
- type RevocationListVO
- type RevocationVO
- type RevocationsManager
- type RevocationsValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObserveState ¶
type ObserveState uint64
type ObserverGroup ¶
type ObserverGroup struct {
// contains filtered or unexported fields
}
Manage a group of observers (to any kind of resource) An observer is just a channel receiving an ObserverGroupState as notification
func NewObserverGroup ¶
func NewObserverGroup(initialState ObserveState, logger logging.Logger) *ObserverGroup
Create a new observer group Usually there should be only one per resource
func (*ObserverGroup) AddObserver ¶
func (g *ObserverGroup) AddObserver(atState ObserveState) chan ObserveState
Convenient function to add an observer to the group Result is a channel that will receive an empty struct{} on notification
func (*ObserverGroup) AddObserverWithTimeout ¶
func (g *ObserverGroup) AddObserverWithTimeout(atState ObserveState, timeout time.Duration) chan ObserveState
Convenient function to add an observer with timeout to the group Result is a channel that is guaranteed to receive a notification within a given amount of time
func (*ObserverGroup) AttachObserver ¶
func (g *ObserverGroup) AttachObserver(atState ObserveState, observer chan ObserveState)
Attach an observer to the group
func (*ObserverGroup) DetachObserver ¶
func (g *ObserverGroup) DetachObserver(observer chan ObserveState) bool
Detach an observer from the group
func (*ObserverGroup) Notify ¶
func (g *ObserverGroup) Notify(nextState ObserveState)
Notify all observers in the group Each observer will be notified only once, after notification the observer will be removed from the group
type RevocationListVO ¶
type RevocationListVO struct { LastVersion uint64 `json:"last_version"` Revocations []*RevocationVO `json:"revocations"` }
func NewRevocationListVO ¶
func NewRevocationListVO(version uint64, revokations []*RevocationVO) *RevocationListVO
type RevocationVO ¶
type RevocationVO struct { Version uint64 `json:"version"` Sha256 common.RawSha256 `json:"sha256"` ExpiresAt int64 `json:"expires_at"` }
func NewRevokationVO ¶
type RevocationsManager ¶
type RevocationsManager struct { *RevocationsValidator // contains filtered or unexported fields }
Cache/manage revocations Benchmark BenchmarkRevocationsManagerFill-8 1000000 1653 ns/op 234 B/op 7 allocs/op
func NewRevocationsManager ¶
func NewRevocationsManager(store store.ServerStore, parent logging.Logger) (*RevocationsManager, error)
Create a new revocations cache Usually there should only be one
func (*RevocationsManager) AddRevocation ¶
Add a revocation
func (*RevocationsManager) CurrentVersion ¶
func (r *RevocationsManager) CurrentVersion() uint64
func (*RevocationsManager) GetRevocationsSinceVersion ¶
func (r *RevocationsManager) GetRevocationsSinceVersion(version uint64, maxLength int) *RevocationListVO
Get all revocations since a given version
func (*RevocationsManager) StartCleanup ¶
func (r *RevocationsManager) StartCleanup()
type RevocationsValidator ¶
type RevocationsValidator struct { Observe *ObserverGroup // contains filtered or unexported fields }
func NewRevocationsValidator ¶
func NewRevocationsValidator(store store.AgentStore, parent logging.Logger) *RevocationsValidator