scalefile

package module
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: Apache-2.0 Imports: 5 Imported by: 4

README

Scalefile

Discord

Golang Typescript

This library contains the definitions and library for working with Scalefiles used by Scale Functions.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/loopholelabs/scalefile. For more contribution information check out the contribution guide.

License

The Scalefile project is available as open source under the terms of the Apache License, Version 2.0.

Code of Conduct

Everyone interacting in the Scalefile project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the CNCF Code of Conduct.

Project Managed By:

Documentation

Overview

Package scalefile implements the ScaleFile type, as well as any helper functions for interacting with ScaleFile types

Index

Constants

This section is empty.

Variables

View Source
var (
	VersionErr  = errors.New("unknown or invalid version")
	LanguageErr = errors.New("unknown or invalid language")
)
View Source
var (
	// AcceptedVersions is an array of acceptable Versions
	AcceptedVersions = []Version{V1Alpha}
)

Functions

func Encode

func Encode(writer io.Writer, scalefile *ScaleFile) error

Encode writes the given scalefile to the given io.Writer

func Write

func Write(path string, scalefile *ScaleFile) error

Write opens a file at the given path and writes the given scalefile to it

Types

type Dependency

type Dependency struct {
	Name    string `json:"name" yaml:"name"`
	Version string `json:"version" yaml:"version"`
}

Dependency outlines the Dependency of a Scale Function

type ScaleFile

type ScaleFile struct {
	Version      Version            `json:"version" yaml:"version"`
	Name         string             `json:"name" yaml:"name"`
	Tag          string             `json:"tag" yaml:"tag"`
	Signature    string             `json:"signature" yaml:"signature"`
	Language     scalefunc.Language `json:"language" yaml:"language"`
	Dependencies []Dependency       `json:"dependencies" yaml:"dependencies"`
	Source       string             `json:"source" yaml:"source"`
}

ScaleFile describes the Scale Function and its dependencies

func Decode

func Decode(reader io.Reader) (*ScaleFile, error)

Decode reads the data stored in the given io.Reader and returns a *ScaleFile

func Read

func Read(path string) (*ScaleFile, error)

Read opens a file at the given path and returns a *ScaleFile

type Version

type Version string

Version is the Version of the ScaleFile definition

const (
	// V1Alpha is the V1 Alpha definition of a ScaleFile
	V1Alpha Version = "v1alpha"
)

Directories

Path Synopsis
Package scalefunc implements the ScaleFunc type, as well as any helper functions for interacting with ScaleFunc types
Package scalefunc implements the ScaleFunc type, as well as any helper functions for interacting with ScaleFunc types

Jump to

Keyboard shortcuts

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