database

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigCache

type ConfigCache interface {
	GetConfigObject(context.Context, *configV1.ConfigRef) (*configV1.ConfigObject, error)
	GetScripts(context.Context, *configV1.BrowserConfig) ([]*configV1.ConfigObject, error)
}

func NewConfigCache

func NewConfigCache(db DbAdapter, ttl time.Duration) ConfigCache

type DbAdapter

type DbAdapter interface {
	GetConfigObject(context.Context, *configV1.ConfigRef) (*configV1.ConfigObject, error)
	GetConfigsForSelector(context.Context, configV1.Kind, *configV1.Label) ([]*configV1.ConfigObject, error)
}

type MockConnection

type MockConnection struct {
	*RethinkDbConnection
}

func NewMockConnection

func NewMockConnection() *MockConnection

NewMockConnection creates a new mocked RethinkDbConnection object

func (*MockConnection) Close

func (c *MockConnection) Close() error

func (*MockConnection) GetConfigObject

func (c *MockConnection) GetConfigObject(ctx context.Context, ref *configV1.ConfigRef) (*configV1.ConfigObject, error)

func (*MockConnection) GetConfigsForSelector

func (c *MockConnection) GetConfigsForSelector(ctx context.Context, kind configV1.Kind, label *configV1.Label) ([]*configV1.ConfigObject, error)

func (*MockConnection) GetMock

func (c *MockConnection) GetMock() *r.Mock

type Options

type Options struct {
	Username           string
	Password           string
	Database           string
	UseOpenTracing     bool
	Address            string
	QueryTimeout       time.Duration
	MaxRetries         int
	MaxOpenConnections int
}

type RethinkDbConnection

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

RethinkDbConnection holds the database connection database

func NewRethinkDbConnection

func NewRethinkDbConnection(opts Options) *RethinkDbConnection

NewRethinkDbConnection creates a new RethinkDbConnection object

func (*RethinkDbConnection) Close

func (c *RethinkDbConnection) Close() error

Close closes the RethinkDbConnection

func (*RethinkDbConnection) Connect

func (c *RethinkDbConnection) Connect() error

Connect establishes connections

func (*RethinkDbConnection) GetConfigObject

func (c *RethinkDbConnection) GetConfigObject(ctx context.Context, ref *configV1.ConfigRef) (*configV1.ConfigObject, error)

GetConfigObject fetches a config.ConfigObject referenced by a config.ConfigRef

func (*RethinkDbConnection) GetConfigsForSelector

func (c *RethinkDbConnection) GetConfigsForSelector(ctx context.Context, kind configV1.Kind, label *configV1.Label) ([]*configV1.ConfigObject, error)

GetConfigsForSelector fetches a list of config.ConfigObject's matching config.Kind and config.Label

Jump to

Keyboard shortcuts

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