db

package
v3.9.1-2867 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements DB operations

func NewClient

func NewClient(cacheDir string, quiet bool, opts ...Option) *Client

NewClient is the factory method for DB client

func (*Client) Download

func (c *Client) Download(ctx context.Context, dst string, opt types.RegistryOptions) error

Download downloads the DB file

func (*Client) NeedsUpdate

func (c *Client) NeedsUpdate(cliVersion string, skip bool) (bool, error)

NeedsUpdate check is DB needs update

type MockOperation

type MockOperation struct {
	mock.Mock
}

MockOperation is an autogenerated mock type for the Operation type

func (*MockOperation) ApplyDownloadExpectation

func (_m *MockOperation) ApplyDownloadExpectation(e OperationDownloadExpectation)

func (*MockOperation) ApplyDownloadExpectations

func (_m *MockOperation) ApplyDownloadExpectations(expectations []OperationDownloadExpectation)

func (*MockOperation) ApplyNeedsUpdateExpectation

func (_m *MockOperation) ApplyNeedsUpdateExpectation(e OperationNeedsUpdateExpectation)

func (*MockOperation) ApplyNeedsUpdateExpectations

func (_m *MockOperation) ApplyNeedsUpdateExpectations(expectations []OperationNeedsUpdateExpectation)

func (*MockOperation) Download

func (_m *MockOperation) Download(ctx context.Context, dst string, opt types.RegistryOptions) error

Download provides a mock function with given fields: ctx, dst

func (*MockOperation) NeedsUpdate

func (_m *MockOperation) NeedsUpdate(cliVersion string, skip bool) (bool, error)

NeedsUpdate provides a mock function with given fields: cliVersion, skip

type Operation

type Operation interface {
	NeedsUpdate(cliVersion string, skip bool) (need bool, err error)
	Download(ctx context.Context, dst string, opt types.RegistryOptions) (err error)
}

Operation defines the DB operations

type OperationDownloadArgs

type OperationDownloadArgs struct {
	Ctx         context.Context
	CtxAnything bool
	Dst         string
	DstAnything bool
}

type OperationDownloadExpectation

type OperationDownloadExpectation struct {
	Args    OperationDownloadArgs
	Returns OperationDownloadReturns
}

type OperationDownloadReturns

type OperationDownloadReturns struct {
	Err error
}

type OperationNeedsUpdateArgs

type OperationNeedsUpdateArgs struct {
	CliVersion         string
	CliVersionAnything bool
	Skip               bool
	SkipAnything       bool
}

type OperationNeedsUpdateExpectation

type OperationNeedsUpdateExpectation struct {
	Args    OperationNeedsUpdateArgs
	Returns OperationNeedsUpdateReturns
}

type OperationNeedsUpdateReturns

type OperationNeedsUpdateReturns struct {
	Need bool
	Err  error
}

type Option

type Option func(*options)

Option is a functional option

func WithClock

func WithClock(c clock.Clock) Option

WithClock takes a clock

func WithDBRepository

func WithDBRepository(dbRepository string) Option

WithDBRepository takes a dbRepository

func WithOCIArtifact

func WithOCIArtifact(art *oci.Artifact) Option

WithOCIArtifact takes an OCI artifact

Jump to

Keyboard shortcuts

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