v1alpha2

package
v0.0.0-...-27989e3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 6 Imported by: 55

Documentation

Index

Constants

View Source
const (
	COAMetaHeader           = "COA_META_HEADER"
	TracingExporterConsole  = "tracing.exporters.console"
	MetricsExporterOTLPgRPC = "metrics.exporters.otlpgrpc"
	TracingExporterZipkin   = "tracing.exporters.zipkin"
	TracingExporterOTLPgRPC = "tracing.exporters.otlpgrpc"
	ProvidersState          = "providers.state"
	ProvidersConfig         = "providers.config"
	ProvidersSecret         = "providers.secret"
	ProvidersReference      = "providers.reference"
	ProvidersProbe          = "providers.probe"
	ProvidersUploader       = "providers.uploader"
	ProvidersReporter       = "providers.reporter"
	ProviderQueue           = "providers.queue"
	ProviderLedger          = "providers.ledger"
	StatusOutput            = "__status"
	ErrorOutput             = "__error"
	StateOutput             = "__state"
)

Variables

This section is empty.

Functions

func IsDelayed

func IsDelayed(err error) bool

func IsNotFound

func IsNotFound(err error) bool

Types

type ActivationData

type ActivationData struct {
	Campaign             string                            `json:"campaign"`
	Namespace            string                            `json:"namespace,omitempty"`
	Activation           string                            `json:"activation"`
	ActivationGeneration string                            `json:"activationGeneration"`
	Stage                string                            `json:"stage"`
	Inputs               map[string]interface{}            `json:"inputs,omitempty"`
	Outputs              map[string]map[string]interface{} `json:"outputs,omitempty"`
	Provider             string                            `json:"provider,omitempty"`
	Config               interface{}                       `json:"config,omitempty"`
	TriggeringStage      string                            `json:"triggeringStage,omitempty"`
	Schedule             *ScheduleSpec                     `json:"schedule,omitempty"`
	NeedsReport          bool                              `json:"needsReport,omitempty"`
}

type COAError

type COAError struct {
	InnerError error
	Message    string
	State      State
}

func FromError

func FromError(err error) COAError

func FromHTTPResponseCode

func FromHTTPResponseCode(code int, body []byte) COAError

func NewCOAError

func NewCOAError(err error, msg string, state State) COAError

func (COAError) Error

func (e COAError) Error() string

type COAHandler

type COAHandler func(COARequest) COAResponse

type COARequest

type COARequest struct {
	Context     context.Context   `json:"-"`
	Method      string            `json:"method"`
	Route       string            `json:"route"`
	ContentType string            `json:"contentType"`
	Body        []byte            `json:"body"`
	Metadata    map[string]string `json:"metadata,omitempty"`
	Parameters  map[string]string `json:"parameters,omitempty"`
}

func (*COARequest) DeepCopy

func (in *COARequest) DeepCopy() *COARequest

func (*COARequest) DeepCopyInto

func (in *COARequest) DeepCopyInto(out *COARequest)

type COAResponse

type COAResponse struct {
	ContentType string            `json:"contentType"`
	Body        []byte            `json:"body"`
	State       State             `json:"state"`
	Metadata    map[string]string `json:"metadata,omitempty"`
	RedirectUri string            `json:"redirectUri,omitempty"`
}

func (COAResponse) Println

func (c COAResponse) Println()

func (COAResponse) String

func (c COAResponse) String() string

type Endpoint

type Endpoint struct {
	Methods    []string
	Version    string
	Route      string
	Handler    COAHandler
	Parameters []string
}

func (Endpoint) GetPath

func (e Endpoint) GetPath() string

type Event

type Event struct {
	Metadata map[string]string `json:"metadata"`
	Body     interface{}       `json:"body"`
}

func (Event) MarshalBinary

func (e Event) MarshalBinary() (data []byte, err error)

type EventHandler

type EventHandler func(topic string, message Event) error

type HeartBeatAction

type HeartBeatAction string
const (
	HeartBeatUpdate HeartBeatAction = "UPDATE"
	HeartBeatDelete HeartBeatAction = "DELETE"
)

type HeartBeatData

type HeartBeatData struct {
	JobId  string          `json:"id"`
	Scope  string          `json:"scope,omitempty"`
	Action HeartBeatAction `json:"action"`
	Time   time.Time       `json:"time"`
}

type IEdge

type IEdge interface {
	GetFrom() string
	GetTo() string
	GetProperties() map[string]interface{}
}

type INode

type INode interface {
	GetId() string
	GetParent() string
	GetType() string
	GetProperties() map[string]interface{}
}

type InputOutputData

type InputOutputData struct {
	Inputs  map[string]interface{}            `json:"inputs,omitempty"`
	Outputs map[string]map[string]interface{} `json:"outputs,omitempty"`
}

type JobAction

type JobAction string
const (
	JobUpdate JobAction = "UPDATE"
	JobDelete JobAction = "DELETE"
	JobRun    JobAction = "RUN"
)

type JobData

type JobData struct {
	Id     string      `json:"id"`
	Scope  string      `json:"scope,omitempty"`
	Action JobAction   `json:"action"`
	Body   interface{} `json:"body,omitempty"`
	Data   []byte      `json:"data"`
}

type SafeBuffer

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

func (*SafeBuffer) Reset

func (sb *SafeBuffer) Reset()

func (*SafeBuffer) String

func (sb *SafeBuffer) String() string

func (*SafeBuffer) Write

func (sb *SafeBuffer) Write(p []byte) (n int, err error)

type ScheduleSpec

type ScheduleSpec struct {
	Date string `json:"date"`
	Time string `json:"time"`
	Zone string `json:"zone"`
}

func (ScheduleSpec) GetTime

func (s ScheduleSpec) GetTime() (time.Time, error)

func (ScheduleSpec) ShouldFireNow

func (s ScheduleSpec) ShouldFireNow() (bool, error)

type SiteConnection

type SiteConnection struct {
	BaseUrl  string `json:"baseUrl"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type SiteInfo

type SiteInfo struct {
	SiteId      string            `json:"siteId"`
	Properties  map[string]string `json:"properties,omitempty"`
	ParentSite  SiteConnection    `json:"parentSite,omitempty"`
	CurrentSite SiteConnection    `json:"currentSite"`
}

type State

type State uint16

State represents a response state

const (
	// OK = HTTP 200
	OK State = 200
	// Accepted = HTTP 202
	Accepted State = 202
	// BadRequest = HTTP 400
	BadRequest State = 400
	// Unauthorized = HTTP 403
	Unauthorized State = 403
	// NotFound = HTTP 404
	NotFound State = 404
	// MethodNotAllowed = HTTP 405
	MethodNotAllowed State = 405
	Conflict         State = 409
	// InternalError = HTTP 500
	InternalError State = 500
	// Config errors
	BadConfig     State = 1000
	MissingConfig State = 1001
	// API invocation errors
	InvalidArgument State = 2000
	APIRedirect     State = 3030
	// IO errors
	FileAccessError State = 4000
	// Serialization errors
	SerializationError State = 5000
	DeserializeError   State = 5001
	// Async requets
	DeleteRequested State = 6000
	// Operation results
	UpdateFailed   State = 8001
	DeleteFailed   State = 8002
	ValidateFailed State = 8003
	Updated        State = 8004
	Deleted        State = 8005
	// Workflow status
	Running        State = 9994
	Paused         State = 9995
	Done           State = 9996
	Delayed        State = 9997
	Untouched      State = 9998
	NotImplemented State = 9999

	// To have clearer metrics/self-explanatory errors, we introduce some
	// detailed error codes
	InitFailed                   State = 10000
	CreateActionConfigFailed     State = 10001
	HelmActionFailed             State = 10002
	GetComponentSpecFailed       State = 10003
	CreateProjectorFailed        State = 10004
	K8sRemoveServiceFailed       State = 10005
	K8sRemoveDeploymentFailed    State = 10006
	K8sDeploymentFailed          State = 10007
	ReadYamlFailed               State = 10008
	ApplyYamlFailed              State = 10009
	ReadResourcePropertyFailed   State = 10010
	ApplyResourceFailed          State = 10011
	DeleteYamlFailed             State = 10012
	DeleteResourceFailed         State = 10013
	CheckResourceStatusFailed    State = 10014
	ApplyScriptFailed            State = 10015
	RemoveScriptFailed           State = 10016
	YamlResourcePropertyNotFound State = 10017
	GetHelmPropertyFailed        State = 10018
	HelmChartPullFailed          State = 10019
	HelmChartLoadFailed          State = 10020
	HelmChartApplyFailed         State = 10021
	HelmChartUninstallFailed     State = 10022

	// instance controller errors
	SolutionGetFailed             State = 11000
	TargetCandidatesNotFound      State = 11001
	TargetListGetFailed           State = 11002
	ObjectInstanceCoversionFailed State = 11003
	TimedOut                      State = 11004

	//target controller errors
	TargetPropertyNotFound State = 12000
)

func (State) String

func (s State) String() string

type Terminable

type Terminable interface {
	Shutdown(ctx context.Context) error
}

State represents a response state

type Trail

type Trail struct {
	Origin     string                 `json:"origin"`
	Catalog    string                 `json:"catalog"`
	Type       string                 `json:"type"`
	Properties map[string]interface{} `json:"properties"`
}

Jump to

Keyboard shortcuts

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