v1alpha2

package
v0.0.0-...-726864f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 7 Imported by: 61

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"
	LogExporterConsole       = "log.exporters.console"
	LogExporterOTLPgRPC      = "log.exporters.otlpgrpc"
	LogExporterOTLPhTTP      = "log.exporters.otlphttp"
	ProvidersPersistentState = "providers.persistentstate"
	ProvidersVolatileState   = "providers.volatilestate"
	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 COARequestEquals

func COARequestEquals(a, b *COARequest) bool

func EventEquals

func EventEquals(e1, e2 *Event) bool

func EventShouldRetryWrapper

func EventShouldRetryWrapper(handler EventHandler, topic string, message Event) bool

func IsBadConfig

func IsBadConfig(err error) bool

func IsDelayed

func IsDelayed(err error) bool

func IsNotFound

func IsNotFound(err error) bool

func IsRetriableErr

func IsRetriableErr(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             string                            `json:"schedule,omitempty"`
	NeedsReport          bool                              `json:"needsReport,omitempty"`
}

func (ActivationData) MarshalJSON

func (s ActivationData) MarshalJSON() ([]byte, error)

MarshalJSON customizes the JSON marshalling for ActivationData

func (ActivationData) ShouldFireNow

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

func (*ActivationData) UnmarshalJSON

func (s *ActivationData) UnmarshalJSON(data []byte) error

UnmarshalJSON customizes the JSON unmarshalling for ActivationData

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)

func (COARequest) DeepEquals

func (in COARequest) DeepEquals(other COARequest) bool

func (COARequest) MarshalJSON

func (in COARequest) MarshalJSON() ([]byte, error)

func (*COARequest) UnmarshalJSON

func (in *COARequest) UnmarshalJSON(data []byte) error

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 ContextKey

type ContextKey string
const (
	COAFastHTTPContextKey ContextKey = "coa-fasthttp-context"
)

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"`
	Context  context.Context   `json:"-"`
}

func (*Event) DeepCopy

func (e *Event) DeepCopy() *Event

func (Event) DeepEquals

func (e Event) DeepEquals(other Event) bool

func (Event) MarshalBinary

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

func (Event) MarshalJSON

func (e Event) MarshalJSON() ([]byte, error)

func (*Event) UnmarshalJSON

func (e *Event) UnmarshalJSON(data []byte) error

type EventHandler

type EventHandler struct {
	Handler func(topic string, message Event) error
	// Group is used to distinguish different handlers for the same topic
	// Important: The Group name of an existing handler should NOT be modified.
	Group string
}

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,omitempty"`
	Time      time.Time       `json:"time,omitempty"`
	JobAction JobAction       `json:"jobaction"`
}

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 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 (
	None State = 0
	// 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
	IngressApplyFailed              State = 10023
	HttpNewRequestFailed            State = 10024
	HttpSendRequestFailed           State = 10025
	HttpErrorResponse               State = 10026
	MqttPublishFailed               State = 10027
	MqttApplyFailed                 State = 10028
	MqttApplyTimeout                State = 10029
	ConfigMapApplyFailed            State = 10030
	HttpBadWaitStatusCode           State = 10031
	HttpNewWaitRequestFailed        State = 10032
	HttpSendWaitRequestFailed       State = 10033
	HttpErrorWaitResponse           State = 10034
	HttpBadWaitExpression           State = 10035
	ScriptExecutionFailed           State = 10036
	ScriptResultParsingFailed       State = 10037
	WaitToGetInstancesFailed        State = 10038
	WaitToGetSitesFailed            State = 10039
	WaitToGetCatalogsFailed         State = 10040
	InvalidWaitObjectType           State = 10041
	CatalogsGetFailed               State = 10042
	InvalidInstanceCatalog          State = 10043
	CreateInstanceFromCatalogFailed State = 10044
	InvalidSolutionCatalog          State = 10045
	CreateSolutionFromCatalogFailed State = 10046
	InvalidTargetCatalog            State = 10047
	CreateTargetFromCatalogFailed   State = 10048
	InvalidCatalogCatalog           State = 10049
	CreateCatalogFromCatalogFailed  State = 10050
	ParentObjectMissing             State = 10051
	ParentObjectCreateFailed        State = 10052
	MaterializeBatchFailed          State = 10053
	DeleteInstanceFailed            State = 10054
	CreateInstanceFailed            State = 10055
	DeploymentNotReached            State = 10056
	InvalidObjectType               State = 10057
	UnsupportedAction               State = 10058

	// 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 GetHttpStatus

func GetHttpStatus(code int) State

func (State) EqualsWithString

func (s State) EqualsWithString(str string) bool

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