cloudinit

package
v1.15.6 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(codecIDString string, data []byte) ([]byte, error)

Decode decodes the given data using the codec from resolving the given codecIDString. It's a shorthand for parsing the FileCodecID and calling the `Decode` method on the obtained FileCodec.

Types

type FileCodec

type FileCodec interface {
	Encode([]byte) ([]byte, error)
	Decode([]byte) ([]byte, error)
}

FileCodec is a codec to en- and decode data in cloud-init scripts with.j

var (
	// B64FileCodec is the base64 FileCodec.
	B64FileCodec FileCodec = b64FileCodec{}
	// GZIPFileCodec is the gzip FileCodec.
	GZIPFileCodec FileCodec = gzipFileCodec{}
)

func FileCodecForID

func FileCodecForID(id FileCodecID) FileCodec

FileCodecForID retrieves the FileCodec for the given FileCodecID.

type FileCodecID

type FileCodecID string

FileCodecID is the id of a FileCodec for cloud-init scripts.

const (
	// B64FileCodecID is the base64 file codec id.
	B64FileCodecID FileCodecID = "b64"
	// GZIPFileCodecID is the gzip file codec id.
	GZIPFileCodecID FileCodecID = "gzip"
	// GZIPB64FileCodecID is the gzip combined with base64 codec id.
	GZIPB64FileCodecID FileCodecID = "gzip+b64"
)

func ParseFileCodecID

func ParseFileCodecID(s string) (FileCodecID, error)

ParseFileCodecID tries to parse a string into a FileCodecID.

Jump to

Keyboard shortcuts

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