memstore

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 6 Imported by: 0

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

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 New

func New() *Store

New returns an empty store using the system clock for leases.

func NewWithClock

func NewWithClock(clock cf.Clock) *Store

NewWithClock returns an empty store using clock for leases.

func (*Store) Acquire

func (s *Store) Acquire(ctx context.Context, key string, ttl time.Duration) (cf.Lease, error)

Acquire implements cf.Leaser.

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

func (s *Store) DeleteConnection(ctx context.Context, owner cf.OwnerID, id string) error

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

func (s *Store) PutBinding(ctx context.Context, b cf.Binding) error

PutBinding implements cf.BindingStore.

func (*Store) PutGrant

func (s *Store) PutGrant(ctx context.Context, g cf.Grant) error

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

func (s *Store) SwapCredential(ctx context.Context, expectActive int, next cf.Credential) error

SwapCredential implements cf.CredentialStore.

func (*Store) UpdateConnection

func (s *Store) UpdateConnection(ctx context.Context, c cf.Connection) (cf.Connection, error)

UpdateConnection implements cf.ConnectionStore.

Jump to

Keyboard shortcuts

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