format

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Runtime *Descriptor   `json:"runtime"       yaml:"runtime"`
	Modules []*Descriptor `json:"modules"       yaml:"modules"`
	Args    []string      `json:"args"          yaml:"args"`
	Env     []string      `json:"env,omitempty" yaml:"env,omitempty"`
}

func (*Config) ContentType

func (c *Config) ContentType() MediaType

func (*Config) MarshalResource

func (c *Config) MarshalResource() ([]byte, error)

func (*Config) UnmarshalResource

func (c *Config) UnmarshalResource(b []byte) error

type Descriptor

type Descriptor struct {
	MediaType   MediaType         `json:"mediaType"             yaml:"mediaType"`
	Digest      Hash              `json:"digest"                yaml:"digest"`
	Size        int64             `json:"size"                  yaml:"size"`
	URLs        []string          `json:"urls,omitempty"        yaml:"urls,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
}

func (*Descriptor) ContentType

func (d *Descriptor) ContentType() MediaType

func (*Descriptor) MarshalResource

func (d *Descriptor) MarshalResource() ([]byte, error)

func (*Descriptor) UnmarshalResource

func (d *Descriptor) UnmarshalResource(b []byte) error

type Hash

type Hash struct {
	Algorithm, Digest string
}

func ParseHash

func ParseHash(s string) Hash

func SHA256

func SHA256(b []byte) Hash

func (Hash) MarshalText

func (h Hash) MarshalText() ([]byte, error)

func (Hash) Short

func (h Hash) Short() string

func (Hash) String

func (h Hash) String() string

func (*Hash) UnmarshalText

func (h *Hash) UnmarshalText(b []byte) error

type LogSegment

type LogSegment struct {
	Number    int       `json:"number"    yaml:"number"`
	Size      int64     `json:"size"      yaml:"size"`
	CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
}

type Manifest

type Manifest struct {
	ProcessID UUID         `json:"id,omitempty"       yaml:"id,omitempty"`
	StartTime time.Time    `json:"startTime"          yaml:"startTime"`
	Process   *Descriptor  `json:"process"            yaml:"process"`
	Segments  []LogSegment `json:"segments,omitempty" yaml:"segments,omitempty"`
}

func (*Manifest) ContentType

func (m *Manifest) ContentType() MediaType

func (*Manifest) MarshalResource

func (m *Manifest) MarshalResource() ([]byte, error)

func (*Manifest) UnmarshalResource

func (m *Manifest) UnmarshalResource(b []byte) error

type MediaType

type MediaType string
const (
	TypeDescriptor        MediaType = "application/vnd.oci.descriptor.v1+json"
	TypeTimecraftRuntime  MediaType = "application/vnd.timecraft.runtime.v1+json"
	TypeTimecraftConfig   MediaType = "application/vnd.timecraft.config.v1+json"
	TypeTimecraftProcess  MediaType = "application/vnd.timecraft.process.v1+json"
	TypeTimecraftProfile  MediaType = "application/vnd.timecraft.profile.v1+pprof"
	TypeTimecraftManifest MediaType = "application/vnd.timecraft.manifest.v1+json"
	TypeTimecraftModule   MediaType = "application/vnd.timecraft.module.v1+wasm"
)

func (MediaType) String

func (m MediaType) String() string

type Module

type Module struct {
	Code []byte
}

func (*Module) ContentType

func (m *Module) ContentType() MediaType

func (*Module) MarshalResource

func (m *Module) MarshalResource() ([]byte, error)

func (*Module) UnmarshalResource

func (m *Module) UnmarshalResource(b []byte) error

type Process

type Process struct {
	ID        UUID        `json:"id"        yaml:"id"`
	StartTime time.Time   `json:"startTime" yaml:"startTime"`
	Config    *Descriptor `json:"config"    yaml:"config"`
}

func (*Process) ContentType

func (p *Process) ContentType() MediaType

func (*Process) MarshalResource

func (p *Process) MarshalResource() ([]byte, error)

func (*Process) UnmarshalResource

func (p *Process) UnmarshalResource(b []byte) error

type Record

type Record struct {
	ID       string
	Process  *Descriptor
	Offset   int64
	Size     int64
	Time     time.Time
	Function string
}

type Resource

type Resource interface {
	ContentType() MediaType
}

type ResourceMarshaler

type ResourceMarshaler interface {
	Resource
	MarshalResource() ([]byte, error)
}

type ResourceUnmarshaler

type ResourceUnmarshaler interface {
	Resource
	UnmarshalResource([]byte) error
}

type Runtime

type Runtime struct {
	Runtime string `json:"runtime" yaml:"runtime"`
	Version string `json:"version" yaml:"version"`
}

func (*Runtime) ContentType

func (r *Runtime) ContentType() MediaType

func (*Runtime) MarshalResource

func (r *Runtime) MarshalResource() ([]byte, error)

func (*Runtime) UnmarshalResource

func (r *Runtime) UnmarshalResource(b []byte) error

type UUID

type UUID = uuid.UUID

Directories

Path Synopsis
Package logsegment contains the definition of the flatbuffers file format for log segments.
Package logsegment contains the definition of the flatbuffers file format for log segments.
Package types contains definitions for types shared across multiple file formats.
Package types contains definitions for types shared across multiple file formats.

Jump to

Keyboard shortcuts

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