metadata

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIStatusAvailable  APIStatus = "available"
	APIStatusRemoved              = "removed"
	APIStatusDeprecated           = "deprecated"
)

Variables

View Source
var (
	ErrNoServiceMetadataFile = errors.New("expected metadata file path, none provided")
	ErrNoAvailableVersions   = errors.New("service metadata contains no available versions")
)

Functions

func CreateGenerationMetadata

func CreateGenerationMetadata(
	apiVersion string,
	apisPath string,
	modificationReason UpdateReason,
	awsSDKGo string,
	generatorFileName string,
) error

CreateGenerationMetadata gathers information about the generated code and save a yaml version in the API version directory

Types

type APIInfo

type APIInfo struct {
	// The API status. Can be one of Available, Removed and Deprecated.
	Status APIStatus
	// the aws-sdk-go version used to generated the apiVersion.
	AWSSDKVersion string
	// Full path of the generator config file.
	GeneratorConfigPath string
	// Full path of the documentation config file.
	DocumentationConfigPath string
	// The API version.
	APIVersion string
}

APIInfo contains information related a specific apiVersion.

type APIStatus

type APIStatus string

type GenerationMetadata

type GenerationMetadata struct {
	// The APIs version e.g v1alpha2
	APIVersion string `json:"api_version"`
	// The checksum of all the combined files generated within the APIs directory
	APIDirectoryChecksum string `json:"api_directory_checksum"`
	// Last modification reason
	LastModification lastModificationInfo `json:"last_modification"`
	// AWS SDK Go version used generate the APIs
	AWSSDKGoVersion string `json:"aws_sdk_go_version"`
	// Information about the ack-generate binary used to generate the APIs
	ACKGenerateInfo ackGenerateInfo `json:"ack_generate_info"`
	// Information about the generator config file used to generate the APIs
	GeneratorConfigInfo generatorConfigInfo `json:"generator_config_info"`
}

GenerationMetadata represents the parameters used to generate/update the API version directory.

This type is public because soon it will be used by conversion generators to load APIs generation metadata. TODO(hilalymh) Add functions to load/edit metadata files.

type ServiceDetails

type ServiceDetails struct {
	// The full display name for the service. eg. Amazon Elastic Kubernetes
	// Service
	FullName string `json:"full_name"`
	// The short name (abbreviation) for the service. eg. S3
	ShortName string `json:"short_name"`
	// The URL of the service's homepage
	Link string `json:"link"`
	// The URL of the service's main documentation/user guide
	Documentation string `json:"documentation"`
}

ServiceDetails contains string identifiers and relevant links for the service

type ServiceMetadata

type ServiceMetadata struct {
	Service ServiceDetails `json:"service"`
	// A list of all generated API versions of the service
	APIVersions []ServiceVersion `json:"api_versions"`
}

ServiceMetadata consists of information about the service and relative links as well as a list of supported/deprecated versions

func NewServiceMetadata

func NewServiceMetadata(
	metadataPath string,
) (*ServiceMetadata, error)

NewServiceMetadata returns a new Metadata object given a supplied path to a metadata file

func (*ServiceMetadata) GetAvailableAPIVersions

func (m *ServiceMetadata) GetAvailableAPIVersions() []string

GetAvailableAPIVersions returns all API versions that have been marked as available

func (*ServiceMetadata) GetDeprecatedAPIVersions

func (m *ServiceMetadata) GetDeprecatedAPIVersions() []string

GetDeprecatedAPIVersions returns all API versions that have been marked as deprecated

func (*ServiceMetadata) GetLatestAPIVersion

func (m *ServiceMetadata) GetLatestAPIVersion() (string, error)

GetLatestAPIVersion returns the latest available API version. This should always be used by the generators as the source of truth for what version to build.

func (*ServiceMetadata) GetRemovedAPIVersions

func (m *ServiceMetadata) GetRemovedAPIVersions() []string

GetRemovedAPIVersions returns all API versions that have been marked as removed

type ServiceVersion

type ServiceVersion struct {
	APIVersion string    `json:"api_version"`
	Status     APIStatus `json:"status"`
}

ServiceVersion describes the status of all existing version of the controller

type UpdateReason

type UpdateReason string

UpdateReason is the reason a package got modified.

const (
	// UpdateReasonAPIGeneration should be used when an API package
	// is modified by the APIs generator (ack-generate apis).
	UpdateReasonAPIGeneration UpdateReason = "API generation"

	// UpdateReasonConversionFunctionsGeneration Should be used when
	// an API package is modified by conversion functions generator.
	// TODO(hilalymh) ack-generate conversion-functions
	UpdateReasonConversionFunctionsGeneration UpdateReason = "Conversion functions generation"
)

Jump to

Keyboard shortcuts

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