db

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MPL-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 struct {
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(connectionString string) (*Database, error)

func (*Database) Close added in v0.1.16

func (d *Database) Close() error

func (*Database) GetUserId added in v0.1.16

func (d *Database) GetUserId(ctx context.Context, apiKey string) (string, error)

func (*Database) LoadUserConfig

func (d *Database) LoadUserConfig(userId string, lock *ConfigLock) (*configpb.Config, error)

func (*Database) LockConfig added in v0.1.16

func (d *Database) LockConfig(ctx context.Context, userId string) (*ConfigLock, error)

func (*Database) StoreUserConfig

func (d *Database) StoreUserConfig(config *configpb.Config, lock *ConfigLock) error

func (*Database) UnlockConfig added in v0.1.16

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

type LockType added in v0.1.16

type LockType string

Jump to

Keyboard shortcuts

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