db

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemaVersion = db.SchemaVersion
)

Variables

View Source
var (
	// GitHub Container Registry
	DefaultGHCRRepository = fmt.Sprintf("%s:%d", "ghcr.io/khulnasoft/tunnel-db", db.SchemaVersion)

	// GCR mirror
	DefaultGCRRepository = fmt.Sprintf("%s:%d", "ghcr.io/khulnasoft/tunnel-db", db.SchemaVersion)

	Init  = db.Init
	Close = db.Close
	Path  = db.Path
)

Functions

func Dir

func Dir(cacheDir string) string

Types

type Client

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

Client implements DB operations

func NewClient

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

NewClient is the factory method for DB client

func (*Client) Clear

func (c *Client) Clear(_ context.Context) error

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(ctx context.Context, cliVersion string, skip bool) (bool, error)

NeedsUpdate check is DB needs update

func (*Client) ShowInfo

func (c *Client) ShowInfo() error

type Option

type Option func(*options)

Option is a functional option

func WithDBRepository

func WithDBRepository(dbRepository []name.Reference) 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