metadata

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2018 License: Apache-2.0 Imports: 7 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppMetadata

type AppMetadata struct {
	Version     string      `json:"version"`
	Name        string      `json:"name"`
	Description string      `json:"description,omitempty"`
	Namespace   string      `json:"namespace,omitempty"`
	Maintainers Maintainers `json:"maintainers,omitempty"`
	Parents     Parents     `yaml:",omitempty" json:"parents,omitempty"`
}

AppMetadata is the format of the data found inside the metadata.yml file

func From

func From(orig AppMetadata, modifiers ...Modifier) AppMetadata

From returns an AppMetadata instance based on the provided AppMetadata and applicable modifier functions

func Load added in v0.5.0

func Load(data []byte) (AppMetadata, error)

Load validates the given data and loads it into a metadata struct

type Maintainer

type Maintainer struct {
	Name  string `json:"name"`
	Email string `json:"email,omitempty"`
}

Maintainer represents one of the apps's maintainers

func (Maintainer) String

func (m Maintainer) String() string

String gives a string representation of a maintainer

type Maintainers

type Maintainers []Maintainer

Maintainers is a list of maintainers

func (Maintainers) String

func (ms Maintainers) String() string

String gives a string representation of a list of maintainers

type Modifier

type Modifier func(AppMetadata) AppMetadata

Modifier is a function signature that takes and returns an AppMetadata object

func WithMaintainers

func WithMaintainers(maintainers Maintainers) Modifier

WithMaintainers returns a modified AppMetadata with updated maintainers field

func WithName

func WithName(name string) Modifier

WithName returns a modified AppMetadata with updated name field

func WithNamespace

func WithNamespace(namespace string) Modifier

WithNamespace returns a modified AppMetadata with updated namespace field

type ParentMetadata

type ParentMetadata struct {
	Name        string      `json:"name"`
	Namespace   string      `json:"namespace,omitempty"`
	Version     string      `json:"version"`
	Maintainers Maintainers `json:"maintainers,omitempty"`
}

ParentMetadata contains historical data of forked packages

type Parents

type Parents []ParentMetadata

Parents is a list of ParentMetadata items

Jump to

Keyboard shortcuts

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