repository

package
v0.0.3-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RepoTypes = [2]string{"redis", "in_memory"}

Functions

This section is empty.

Types

type BaseRepo

type BaseRepo[T any] interface {
	GetAll(ctx context.Context) ([]*T, error)
	Create(ctx context.Context, model T) error
	Update(ctx context.Context, model T) error
}

type IContainerImageRepository

type IContainerImageRepository interface {
	BaseRepo[model.ContainerImage]
	// FindByHash find a single container image by its hash key (format: hashtype:hash)
	FindByHash(ctx context.Context, hashKey string) (containerImage *model.ContainerImage, found bool, err error)
}

IContainerImageRepository interface for a ContainerImage repository that uses the BaseRepo

type RepoType

type RepoType int
const (
	Redis RepoType = iota
	InMemory
)

func RepoTypeFromString

func RepoTypeFromString(value string) (RepoType, error)

func (RepoType) String

func (s RepoType) String() string

type Repositories

type Repositories struct {
	ContainerImageRepo IContainerImageRepository
}

Repositories contains all the repo structs

func InitRepositories

func InitRepositories(repoType RepoType) *Repositories

InitRepositories should be called only ones

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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