core

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SupportedK8sResourceKinds = map[K8sResourceKind]bool{
		K8sDaemonset:   true,
		K8sDeployment:  true,
		K8sStatefulset: true,
	}
)

Functions

func EvaluateContextualTemplate

func EvaluateContextualTemplate(raw string, vars map[string]string) (string, error)

Types

type APIAuth

type APIAuth struct {
	HeaderKey   string `yaml:"header_key"`
	HeaderValue string `yaml:"header_value"`
}

type APIConfig

type APIConfig struct {
	BaseURL           string           `yaml:"base_url"`
	LatestTagEndpoint EndpointConfig   `yaml:"latest_tag"`
	MetadataEndpoint  *EndpointConfig  `yaml:"metadata,omitempty"`
	LogUpload         *LogUploadConfig `yaml:"log_upload,omitempty"`
	TopLevelAuth      *APIAuth         `yaml:"auth,omitempty"`
}

type CompressionType

type CompressionType string
const (
	CompressionGzip CompressionType = "gzip"
	CompressionNoOp                 = ""
)

type EncodingConfig

type EncodingConfig struct {
	Type EncodingType     `yaml:"type"`
	Opts *EncodingOptions `yaml:"options,omitempty"`
}

type EncodingOptions

type EncodingOptions struct {
	Delimiter string `yaml:"delimiter,omitempty"`
}

type EncodingType

type EncodingType string
const (
	EncodingJSON EncodingType = "json"
	EncodingRaw               = "raw"
)

type EndpointConfig

type EndpointConfig struct {
	Endpoint string     `yaml:"endpoint"`
	Params   *ParamConf `yaml:"params,omitempty"`
}

type EntityProperties

type EntityProperties struct {
	ID        string            `yaml:"id"`
	ImageName string            `yaml:"image"`
	K8sPaths  []K8sResourcePath `yaml:"paths"`
}

type Errors

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

func NewErrors

func NewErrors() *Errors

func (*Errors) Addf

func (e *Errors) Addf(format string, args ...any)

func (*Errors) ErrorOrNil

func (e *Errors) ErrorOrNil() error

type K8sResourceIdentifier

type K8sResourceIdentifier struct {
	Namespace     string
	Kind          K8sResourceKind
	Name          string
	UpdateKeyPath string
}

type K8sResourceKind

type K8sResourceKind string
const (
	K8sDaemonset   K8sResourceKind = "ds"
	K8sDeployment  K8sResourceKind = "deploy"
	K8sStatefulset K8sResourceKind = "sts"
)

type K8sResourcePath

type K8sResourcePath string

func (K8sResourcePath) Parse

type LatestTagResponse

type LatestTagResponse struct {
	Tag   string `json:"tag"`
	Image string `json:"image"`
	URL   string `json:"url"`
}

type LogConfig

type LogConfig struct {
	CustomTags map[string]string `yaml:"custom_tags,omitempty"`
}

type LogUploadConfig

type LogUploadConfig struct {
	Enabled                    bool            `yaml:"enabled"`
	PresignedUploadURLEndpoint EndpointConfig  `yaml:"presigned_upload_url"`
	Method                     string          `yaml:"method"`
	Encoding                   *EncodingConfig `yaml:"encoding"`
	Compression                CompressionType `yaml:"compression,omitempty"`
	Params                     *ParamConf      `yaml:"params,omitempty"`
}

type ParamConf

type ParamConf struct {
	QueryParams map[string]string `yaml:"query,omitempty"`
}

type UpdaterConfig

type UpdaterConfig struct {
	Entities []EntityProperties `yaml:"entities"`
	API      APIConfig          `yaml:"api"`
	Log      *LogConfig         `yaml:"log,omitempty"`
	Metadata map[string]string  `yaml:"-"`
}

type VersioningServiceClient

type VersioningServiceClient interface {
	GetLatestApplicableTag(entityID, entityName string) (*LatestTagResponse, error)
	GetPresignedLogUploadURL(logSize int) (string, error)
	UploadLogs(lines []any) error
	GetMetadata() (map[string]string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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