Documentation
¶
Overview ¶
Package memstore is an in-memory [connectionforge.Store] and [connectionforge.Leaser]. It is the reference for behaviour that other stores are compared against, and it is meant for tests and examples.
Index ¶
- type Store
- func (s *Store) Acquire(ctx context.Context, key string, ttl time.Duration) (cf.Lease, error)
- func (s *Store) ActiveCredential(ctx context.Context, owner cf.OwnerID, connectionID string) (cf.Credential, error)
- func (s *Store) CreateConnection(ctx context.Context, c cf.Connection) (cf.Connection, error)
- func (s *Store) DeleteConnection(ctx context.Context, owner cf.OwnerID, id string) error
- func (s *Store) DestroyCredentials(ctx context.Context, owner cf.OwnerID, connectionID string) error
- func (s *Store) GetConnection(ctx context.Context, owner cf.OwnerID, id string) (cf.Connection, error)
- func (s *Store) ListBindings(ctx context.Context, owner cf.OwnerID, connectionID string) ([]cf.Binding, error)
- func (s *Store) ListConnections(ctx context.Context, owner cf.OwnerID, f cf.Filter) ([]cf.Connection, error)
- func (s *Store) ListGrants(ctx context.Context, owner cf.OwnerID, connectionID string) ([]cf.Grant, error)
- func (s *Store) PutBinding(ctx context.Context, b cf.Binding) error
- func (s *Store) PutGrant(ctx context.Context, g cf.Grant) error
- func (s *Store) RemoveBinding(ctx context.Context, owner cf.OwnerID, connectionID string, c cf.Consumer, ...) error
- func (s *Store) RemoveGrant(ctx context.Context, owner cf.OwnerID, connectionID string, p cf.Principal) error
- func (s *Store) SwapCredential(ctx context.Context, expectActive int, next cf.Credential) error
- func (s *Store) UpdateConnection(ctx context.Context, c cf.Connection) (cf.Connection, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is an in-memory store. It is safe for concurrent use.
func NewWithClock ¶
NewWithClock returns an empty store using clock for leases.
func (*Store) ActiveCredential ¶
func (s *Store) ActiveCredential(ctx context.Context, owner cf.OwnerID, connectionID string) (cf.Credential, error)
ActiveCredential implements cf.CredentialStore.
func (*Store) CreateConnection ¶
func (s *Store) CreateConnection(ctx context.Context, c cf.Connection) (cf.Connection, error)
CreateConnection implements cf.ConnectionStore.
func (*Store) DeleteConnection ¶
DeleteConnection implements cf.ConnectionStore.
func (*Store) DestroyCredentials ¶
func (s *Store) DestroyCredentials(ctx context.Context, owner cf.OwnerID, connectionID string) error
DestroyCredentials implements cf.CredentialStore.
func (*Store) GetConnection ¶
func (s *Store) GetConnection(ctx context.Context, owner cf.OwnerID, id string) (cf.Connection, error)
GetConnection implements cf.ConnectionStore.
func (*Store) ListBindings ¶
func (s *Store) ListBindings(ctx context.Context, owner cf.OwnerID, connectionID string) ([]cf.Binding, error)
ListBindings implements cf.BindingStore.
func (*Store) ListConnections ¶
func (s *Store) ListConnections(ctx context.Context, owner cf.OwnerID, f cf.Filter) ([]cf.Connection, error)
ListConnections implements cf.ConnectionStore.
func (*Store) ListGrants ¶
func (s *Store) ListGrants(ctx context.Context, owner cf.OwnerID, connectionID string) ([]cf.Grant, error)
ListGrants implements cf.GrantStore.
func (*Store) PutBinding ¶
PutBinding implements cf.BindingStore.
func (*Store) PutGrant ¶
PutGrant implements cf.GrantStore.
func (*Store) RemoveBinding ¶
func (s *Store) RemoveBinding(ctx context.Context, owner cf.OwnerID, connectionID string, c cf.Consumer, purpose string) error
RemoveBinding implements cf.BindingStore.
func (*Store) RemoveGrant ¶
func (s *Store) RemoveGrant(ctx context.Context, owner cf.OwnerID, connectionID string, p cf.Principal) error
RemoveGrant implements cf.GrantStore.
func (*Store) SwapCredential ¶
SwapCredential implements cf.CredentialStore.
func (*Store) UpdateConnection ¶
func (s *Store) UpdateConnection(ctx context.Context, c cf.Connection) (cf.Connection, error)
UpdateConnection implements cf.ConnectionStore.