metadata

package
v0.0.0-...-3b47d42 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package metadata provides a data structure to hold build metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

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

Metadata contains structured metadata for the build. It can hold arbitrary key-value pairs, but some keys are well-known:

  • num_cpu: number of CPUs
  • goos: the value of Go's GOOS constant
  • goarch: the value of Go's GOARCH constant

func New

func New() Metadata

New returns an initialized Metadata struct.

func (Metadata) Get

func (md Metadata) Get(key string) string

Get returns the value for the given key. If the key is not set, it returns the empty string.

func (Metadata) Keys

func (md Metadata) Keys() []string

Keys returns a list of all available keys in the metadata.

func (Metadata) Set

func (md Metadata) Set(key, value string) error

Set sets a key-value pair in the metadata.

func (Metadata) Size

func (md Metadata) Size() int

Size returns the number of key-value pairs in the metadata.

func (Metadata) SortedKeys

func (md Metadata) SortedKeys() []string

SortedKeys returns a sorted list of all available keys in the metadata.

Jump to

Keyboard shortcuts

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