db

package
v0.1.50 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainConfigLock = "main"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigLock added in v0.1.16

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

func (*ConfigLock) IsActive added in v0.1.16

func (l *ConfigLock) IsActive() bool

type Database

type Database interface {
	LockDatabase
	GetUserId(ctx context.Context, apiKey string) (string, error)
	CreateUser(ctx context.Context, emailAddress string) (apiKey string, err error)
	StoreUserConfig(config *configpb.Config, lock *ConfigLock) error
	LoadUserConfig(userId string, lock *ConfigLock) (*configpb.Config, error)
	Close() error
}

func NewDatabase

func NewDatabase(awsClient aws_client.AwsClient) (Database, error)

type LocalLockDatabase added in v0.1.36

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

func (*LocalLockDatabase) LockConfig added in v0.1.36

func (d *LocalLockDatabase) LockConfig(_ context.Context, userId string) (lock *ConfigLock, err error)

func (*LocalLockDatabase) UnlockConfig added in v0.1.36

func (d *LocalLockDatabase) UnlockConfig(_ context.Context, lock *ConfigLock) error

type LockDatabase added in v0.1.36

type LockDatabase interface {
	LockConfig(ctx context.Context, userId string) (lock *ConfigLock, err error)
	UnlockConfig(ctx context.Context, lock *ConfigLock) error
}

type LockType added in v0.1.16

type LockType string

type RemoteLockDatabase added in v0.1.36

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

func NewLockDatabase added in v0.1.36

func NewLockDatabase(dbConnection *sql.DB) (*RemoteLockDatabase, error)

func (*RemoteLockDatabase) LockConfig added in v0.1.36

func (d *RemoteLockDatabase) LockConfig(ctx context.Context, userId string) (lock *ConfigLock, err error)

func (*RemoteLockDatabase) UnlockConfig added in v0.1.36

func (d *RemoteLockDatabase) UnlockConfig(ctx context.Context, lock *ConfigLock) error

Jump to

Keyboard shortcuts

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