encoding

package
v0.6.16 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: Apache-2.0 Imports: 5 Imported by: 10

README

models

Use the structs in this package to serialize YAML files that can be read by registry apply.

Documentation

Overview

package encoding provides structs that can be used to serialize YAML files for import with `registry apply`.

Index

Constants

View Source
const RegistryV1 = "apigeeregistry/v1"

Variables

This section is empty.

Functions

func EncodeYAML

func EncodeYAML(model interface{}) ([]byte, error)

Encode a model as YAML.

func NodeForMessage

func NodeForMessage(m proto.Message) (*yaml.Node, error)

NodeForMessage converts a proto message for export as a YAML node.

func StyleForJSON

func StyleForJSON(node *yaml.Node)

StyleForJSON sets the style field on a tree of yaml.Nodes for JSON export.

func StyleForYAML

func StyleForYAML(node *yaml.Node)

StyleForYAML sets the style field on a tree of yaml.Nodes for YAML export.

Types

type Api

type Api struct {
	Header `yaml:",inline"`
	Data   ApiData `yaml:"data"`
}

type ApiData

type ApiData struct {
	DisplayName           string           `yaml:"displayName,omitempty"`
	Description           string           `yaml:"description,omitempty"`
	Availability          string           `yaml:"availability,omitempty"`
	RecommendedVersion    string           `yaml:"recommendedVersion,omitempty"`
	RecommendedDeployment string           `yaml:"recommendedDeployment,omitempty"`
	ApiVersions           []*ApiVersion    `yaml:"versions,omitempty"`
	ApiDeployments        []*ApiDeployment `yaml:"deployments,omitempty"`
	Artifacts             []*Artifact      `yaml:"artifacts,omitempty"`
}

type ApiDeployment

type ApiDeployment struct {
	Header `yaml:",inline"`
	Data   ApiDeploymentData `yaml:"data"`
}

type ApiDeploymentData

type ApiDeploymentData struct {
	DisplayName        string      `yaml:"displayName,omitempty"`
	Description        string      `yaml:"description,omitempty"`
	ApiSpecRevision    string      `yaml:"apiSpecRevision,omitempty"`
	EndpointURI        string      `yaml:"endpointURI,omitempty"`
	ExternalChannelURI string      `yaml:"externalChannelURI,omitempty"`
	IntendedAudience   string      `yaml:"intendedAudience,omitempty"`
	AccessGuidance     string      `yaml:"accessGuidance,omitempty"`
	Artifacts          []*Artifact `yaml:"artifacts,omitempty"`
}

type ApiSpec

type ApiSpec struct {
	Header `yaml:",inline"`
	Data   ApiSpecData `yaml:"data"`
}

type ApiSpecData

type ApiSpecData struct {
	FileName    string      `yaml:"filename,omitempty"`
	Description string      `yaml:"description,omitempty"`
	MimeType    string      `yaml:"mimeType,omitempty"`
	SourceURI   string      `yaml:"sourceURI,omitempty"`
	Artifacts   []*Artifact `yaml:"artifacts,omitempty"`
}

type ApiVersion

type ApiVersion struct {
	Header `yaml:",inline"`
	Data   ApiVersionData `yaml:"data"`
}

type ApiVersionData

type ApiVersionData struct {
	DisplayName string      `yaml:"displayName,omitempty"`
	Description string      `yaml:"description,omitempty"`
	State       string      `yaml:"state,omitempty"`
	PrimarySpec string      `yaml:"primarySpec,omitempty"`
	ApiSpecs    []*ApiSpec  `yaml:"specs,omitempty"`
	Artifacts   []*Artifact `yaml:"artifacts,omitempty"`
}

type Artifact

type Artifact struct {
	Header `yaml:",inline"`
	Data   yaml.Node `yaml:"data"`
}
type Header struct {
	ApiVersion string   `yaml:"apiVersion,omitempty"`
	Kind       string   `yaml:"kind,omitempty"`
	Metadata   Metadata `yaml:"metadata,omitempty"`
}

type List

type List struct {
	Header `yaml:",inline"`
	Items  []interface{} `yaml:"items"`
}

type Metadata

type Metadata struct {
	Name        string            `yaml:"name,omitempty"`
	Parent      string            `yaml:"parent,omitempty"`
	Labels      map[string]string `yaml:"labels,omitempty"`
	Annotations map[string]string `yaml:"annotations,omitempty"`
}

type Project

type Project struct {
	Header `yaml:",inline"`
	Data   ProjectData `yaml:"data"`
}

type ProjectData

type ProjectData struct {
	DisplayName string `yaml:"displayName,omitempty"`
	Description string `yaml:"description,omitempty"`
}

Jump to

Keyboard shortcuts

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