Documentation
¶
Overview ¶
Package storage is used to store and retrieve built Scale Functions
Package storage is used to store and retrieve built Scale Functions ¶
Package storage is used to store and retrieve built Scale Functions ¶
Package storage is used to store and retrieve built Scale Functions and Scale Signatures
Index ¶
- Constants
- Variables
- func GenerateSignature(sig *signature.Schema, name string, tag string, org string, directory string) error
- type Build
- type BuildStorage
- type Function
- type FunctionStorage
- func (s *FunctionStorage) Delete(name string, tag string, org string, hash string) error
- func (s *FunctionStorage) Get(name string, tag string, org string, hash string) (*Function, error)
- func (s *FunctionStorage) List() ([]Function, error)
- func (s *FunctionStorage) Put(name string, tag string, org string, sf *scalefunc.Schema) error
- type Signature
- type SignatureStorage
- func (s *SignatureStorage) Delete(name string, tag string, org string, hash string) error
- func (s *SignatureStorage) Get(name string, tag string, org string, hash string) (*Signature, error)
- func (s *SignatureStorage) List() ([]Signature, error)
- func (s *SignatureStorage) Path(name string, tag string, org string, hash string) (string, error)
- func (s *SignatureStorage) Put(name string, tag string, org string, sig *signature.Schema) error
Constants ¶
const (
BuildDirectory = "builds"
)
const (
DefaultDirectory = ".config/scale"
)
const (
FunctionDirectory = "functions"
)
const (
SignatureDirectory = "signatures"
)
Variables ¶
Functions ¶
Types ¶
type BuildStorage ¶
type BuildStorage struct {
Directory string
}
var (
DefaultBuild *BuildStorage
)
func NewBuild ¶
func NewBuild(baseDirectory string) (*BuildStorage, error)
func (*BuildStorage) Delete ¶
func (s *BuildStorage) Delete(b *Build) error
func (*BuildStorage) Mkdir ¶
func (s *BuildStorage) Mkdir() (*Build, error)
Mkdir creates and returns a new build directory
type FunctionStorage ¶
type FunctionStorage struct {
Directory string
}
FunctionStorage is used to store and retrieve built Scale Functions
var (
DefaultFunction *FunctionStorage
)
func NewFunction ¶
func NewFunction(baseDirectory string) (*FunctionStorage, error)
func (*FunctionStorage) Delete ¶
Delete removes the Scale Function with the given name, tag, org, and hash
func (*FunctionStorage) Get ¶
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 (*FunctionStorage) List ¶
func (s *FunctionStorage) List() ([]Function, error)
List returns all the Scale Functions stored in the storage
type SignatureStorage ¶
type SignatureStorage struct {
Directory string
}
var (
DefaultSignature *SignatureStorage
)
func NewSignature ¶
func NewSignature(baseDirectory string) (*SignatureStorage, error)
func (*SignatureStorage) Delete ¶
Delete removes the Scale Signature with the given name, tag, org, and hash
func (*SignatureStorage) Get ¶
func (s *SignatureStorage) Get(name string, tag string, org string, hash string) (*Signature, error)
Get returns the Scale Signature with the given name, tag, and organization. The hash parameter is optional and can be used to check for a specific hash.
func (*SignatureStorage) List ¶
func (s *SignatureStorage) List() ([]Signature, error)
List returns all the Scale Signatures stored in the storage