meta

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IDFromFile

func IDFromFile(name string) (string, bool)

func IsID

func IsID(name string) bool

IsID reports whether a name is a workload id, so nothing else a node names is taken for a workload.

Types

type Dir

type Dir struct {
	// contains filtered or unexported fields
}

Dir is the meta dir core writes over ssh, seen by the runtime one kind of workload belongs to.

func NewDir

func NewDir(path string, kind Kind) (*Dir, error)

NewDir creates the dir: it is on tmpfs, so it is empty after a reboot and inotify has nothing to watch.

func (*Dir) List

func (d *Dir) List(ctx context.Context) ([]*File, error)

List returns the meta file of every workload of this dir's kind, skipping the ones it cannot read.

func (*Dir) Read

func (d *Dir) Read(ID string) (*File, error)

Read returns the meta file of one workload of this dir's kind.

func (*Dir) Watch

func (d *Dir) Watch(ctx context.Context, reporter *source.Reporter) error

Watch reports a meta file appearing as a start and its removal as a die, until ctx is done.

type File

type File struct {
	ID          string            `json:"id"`
	Kind        Kind              `json:"kind"`
	Appname     string            `json:"appname"`
	Entrypoint  string            `json:"entrypoint"`
	Ident       string            `json:"ident"`
	Podname     string            `json:"podname"`
	Nodename    string            `json:"nodename"`
	CoreID      string            `json:"coreid"`
	Labels      map[string]string `json:"labels"`
	HealthCheck *healthCheck      `json:"healthcheck"`
	Networks    map[string]string `json:"networks"`
	Cgroup      string            `json:"cgroup"`
	NetnsPID    int               `json:"netns_pid"`
	Iface       string            `json:"iface"`
	Log         logSource         `json:"log"`
}

File is the metadata core writes next to a workload it created over ssh.

func (*File) Workload

func (f *File) Workload(running bool) *source.Workload

Workload renders the metadata as the workload every collector reads.

type Kind

type Kind string

Kind is the runtime the workload a meta file describes belongs to.

const (
	KindProcess Kind = "process"
	KindVM      Kind = "vm"
)

Jump to

Keyboard shortcuts

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