db

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	ScanNetworks(ctx context.Context) ([]*types.Network, error)
	GetNetwork(ctx context.Context, id string) (*types.Network, error)
	PutNetwork(ctx context.Context, n *types.Network) error
	DeleteNetwork(ctx context.Context, id string) error

	ScanPools(ctx context.Context) ([]*types.Pool, error)
	GetPool(ctx context.Context, id string) (*types.Pool, error)
	PutPool(ctx context.Context, p *types.Pool) error
	DeletePool(ctx context.Context, id string) error

	ScanProviders(ctx context.Context) ([]*types.Provider, error)
	GetProvider(ctx context.Context, name string) (*types.Provider, error)
	PutProvider(ctx context.Context, p *types.Provider) error
	DeleteProvider(ctx context.Context, name string) error
}

func New

func New(cli DynamoClient) Database

type DynamoClient

type DynamoClient interface {
	dynamodb.ScanAPIClient
	GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
	PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
	DeleteItem(ctx context.Context, params *dynamodb.DeleteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteItemOutput, error)
	Query(ctx context.Context, params *dynamodb.QueryInput, optFns ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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