storage

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package storage is used to store and retrieve built Scale Functions

Index

Constants

View Source
const (
	DefaultCacheDirectory = ".config/scale/functions"
)

Variables

View Source
var (
	ErrInvalidName         = errors.New("invalid name")
	ErrInvalidTag          = errors.New("invalid tag")
	ErrInvalidOrganization = errors.New("invalid organization")
)

Functions

This section is empty.

Types

type Entry added in v0.3.3

type Entry struct {
	ScaleFunc    *scalefunc.ScaleFunc
	Hash         string
	Organization string
}

type Storage

type Storage struct {
	BaseDirectory string
}

Storage is used to store and retrieve built Scale Functions

var (
	Default *Storage
)

func New

func New(baseDirectory string) (*Storage, error)

func (*Storage) Delete

func (s *Storage) Delete(name string, tag string, org string, hash string) error

Delete removes the Scale Function with the given name, tag, org, and hash

func (*Storage) Get

func (s *Storage) Get(name string, tag string, org string, hash string) (*Entry, error)

Get returns the Scale Function with the given name, tag, and organization. The hash parameter is optional and can be used to check for a specific hash.

func (*Storage) List

func (s *Storage) List() ([]Entry, error)

List returns all the Scale Functions stored in the storage

func (*Storage) Put

func (s *Storage) Put(name string, tag string, org string, hash string, sf *scalefunc.ScaleFunc) error

Put stores the Scale Function with the given name, tag, organization, and hash

Jump to

Keyboard shortcuts

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