manifest

package
v0.0.0-...-1eeb5f6 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COMP_UPDATER = "updater"
)

names of known components

Variables

This section is empty.

Functions

func DecodeMani

func DecodeMani(mani interface{}, data string) error

func EncodeManifest

func EncodeManifest(mani interface{}) (string, error)

func GenCred

func GenCred(user, pass string) (string, error)

Generate credential string with given username and password

Types

type AssetManifest

type AssetManifest struct {
	// url.String()
	Url string `json:"url"`
}

Information to get update manifest

func DecodeAsset

func DecodeAsset(data string) (*AssetManifest, error)

func (*AssetManifest) Decode

func (self *AssetManifest) Decode(data string) error

func (*AssetManifest) Encode

func (self *AssetManifest) Encode() (string, error)

type Component

type Component struct {
	Version         string                   `json:"version"`
	Name            string                   `json:"name"`
	Registry        string                   `json:"registry"`
	ImageName       string                   `json:"image_name"`
	ImageTag        string                   `json:"image_tag"`
	ContainerConfig container.Config         `json:"container_config,omitempty"`
	HostConfig      container.HostConfig     `json:"host_config,omitempty"`
	NetConfig       network.NetworkingConfig `json:"net_config,omitempty"`
	ContainerName   string                   `json:"container_name"`
	Op              UpdateOp                 `json:"op,omitempty"`
	Force           bool                     `json:"force,omitempty"`
	Cred            string                   `json:"cred,omitempty"`
}

Component definition, including informantion like what to run and how to run

type Credential

type Credential struct {
	User string `json:"user"`
	Pass string `json:"pass"`
}

Credential required to get update materials

func GetCred

func GetCred(cred_str string) (*Credential, error)

type SubManifest

type SubManifest struct {
	Uri    string            `json:"uri"`
	Cred   Credential        `json:"cred,omitempty"`
	Queues map[string]string `json:"queues,omitempty"`
	Topics map[string]string `json:"topics,omitempty"`
}

Subscription manifest

func DecodeSub

func DecodeSub(data string) (*SubManifest, error)

func LoadSubMani

func LoadSubMani() (*SubManifest, error)

func (*SubManifest) Decode

func (self *SubManifest) Decode(data string) error

func (*SubManifest) Encode

func (self *SubManifest) Encode() (string, error)

type UpdateManifest

type UpdateManifest struct {
	Signature  string      `json:"signature,omitempty"`
	Digest     string      `json:"digest,omitempty"`
	CreatedAt  time.Time   `json:"created_at,omitempty"`
	Components []Component `json:"components"`
}

Component details for update

func DecodeFromFile

func DecodeFromFile(mani_path string) (*UpdateManifest, error)

func FetchUpdateMani

func FetchUpdateMani(target string) (*UpdateManifest, error)

func (*UpdateManifest) Decode

func (self *UpdateManifest) Decode(data string) error

func (*UpdateManifest) Encode

func (self *UpdateManifest) Encode() (string, error)

func (*UpdateManifest) Generate

func (self *UpdateManifest) Generate(out_path string) error

func (*UpdateManifest) Post

func (self *UpdateManifest) Post(target url.URL) error

type UpdateOp

type UpdateOp int

Define instruction for updater to follow

const (
	// The component need to be updated
	COMPOP_UPDATE UpdateOp = iota
	// The component need to be deprecated
	COMPOP_DEPRECATE
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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