repository

package
v0.0.0-...-8e6c402 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 12 Imported by: 0

README

Coverage of use cases

LoadSois(rootpath string)

  • main.go #33
  • list.go #26
  • open.go #84

LoadSoiData(filepath string)

  • open.go #97
  • tag.go #32

StoreSoiData(filepath string, *model.SoiData)

  • open.go #54
  • tag.go #36

Exists

  • tag.go #27

TODO

  • add bucket args to each repo funcs
  • replace bucket based json soi first

Documentation

Index

Constants

View Source
const (
	RepoTypeFile   = "file"
	RepoTypeSQLite = "sqlite"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository interface {
	Init(ctx context.Context) error
	ListBucket(ctx context.Context) ([]string, error)
	LoadAll(ctx context.Context, bucket string) ([]*model.SoiData, error)
	Load(ctx context.Context, bucket string, hash string) (*model.SoiData, bool, error)
	Store(ctx context.Context, bucket string, soi *model.SoiData) error
	Exists(ctx context.Context, bucket string, hash string) (bool, error)
	Remove(ctx context.Context, bucket string, hash string) error
}

func NewFilesRepository

func NewFilesRepository(path string) (Repository, error)

func NewRepository

func NewRepository(ctx context.Context, conf *config.Config) (Repository, bool, error)

func NewSQLiteRepository

func NewSQLiteRepository(ctx context.Context, basePath, bucket string) (Repository, error)

Jump to

Keyboard shortcuts

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