dba

package
v0.0.0-...-aee609b Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDBA

func NewDBA(r *Repository)

NewDBA sets the repository for the handlers

func SetDefaultExpiry

func SetDefaultExpiry(expires time.Duration)

SetDefaultExpiry update the default expiry for all cached parameters

Note this will update expires value on the next refresh of entries.

Types

type Cache

type Cache interface {
	GetAssets(ctx context.Context) ([]model.Asset, error)
}

Cache SSM cache which provides read access to parameters

func NewCache

func NewCache() Cache

New new SSM cache

type Entry

type Entry struct {
	// contains filtered or unexported fields
}

Entry an SSM entry in the cache

type Repository

type Repository struct {
	App   *config.AppConfig
	Svc   *dynamodb.Client
	Cache Cache
}

Repository is the repository type

var Repo *Repository

Repo the repository used by dynamo

func NewRepo

func NewRepo(a *config.AppConfig) *Repository

NewRepo creates a new repository

func (*Repository) LoadAssets

func (m *Repository) LoadAssets(ctx context.Context) ([]model.Asset, error)

func (*Repository) PutAsset

func (m *Repository) PutAsset(ctx context.Context, asset *model.Asset) error

Jump to

Keyboard shortcuts

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