adapters

package
v0.4.26 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerKey         = "server"
	MeshSpecKey       = "mesh"
	OperationsKey     = "operations"
	KubeconfigPathKey = "kubeconfig-path"
)

Variables

View Source
var (
	NoneVersion  = []Version{"none"}
	NoneTemplate = []Template{"none"}
)

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	Config              config.Handler
	KubeConfigHandler   config.Handler
	Log                 meshlogger.Logger
	CloudEventsStreamer *events.CloudEventsStreamer
}

func (*Adapter) ApplyOperation

func (h *Adapter) ApplyOperation(ctx context.Context, op OperationRequest) error

func (*Adapter) GetComponentInfo

func (h *Adapter) GetComponentInfo(svc interface{}) error

func (*Adapter) GetName

func (h *Adapter) GetName() string

func (*Adapter) GetVersion

func (h *Adapter) GetVersion() string

func (*Adapter) StreamErr

func (h *Adapter) StreamErr(e *meshes.CloudEventsResponse, err error)

func (*Adapter) StreamInfo

func (h *Adapter) StreamInfo(e *meshes.CloudEventsResponse)

type Handler

type Handler interface {
	GetName() string
	GetComponentInfo(interface{}) error
	ApplyOperation(context.Context, OperationRequest) error
	ListOperations() (Operations, error)
	ProcessOAM(ctx context.Context) (string, error)
	StreamErr(*meshes.CloudEventsResponse, error)
	StreamInfo(*meshes.CloudEventsResponse)
}

func AddLogger

func AddLogger(logger meshlogger.Logger, h Handler) Handler

type Operation

type Operation struct {
	Type                 int32             `json:"type,string,omitempty"`
	Description          string            `json:"description,omitempty"`
	Versions             []Version         `json:"versions,omitempty"`
	Templates            []Template        `json:"templates,omitempty"`
	Services             []Service         `json:"services,omitempty"`
	AdditionalProperties map[string]string `json:"additional_properties,omitempty"`
}

type OperationRequest

type OperationRequest struct {
	OperationName     string
	Namespace         string
	Username          string
	CustomBody        string
	IsDeleteOperation bool
	OperationID       string
	K8sConfigs        []string
}

type Operations

type Operations map[string]*Operation

type Service

type Service string

type Spec

type Spec struct {
	Name    string `json:"name"`
	Status  string `json:"status"`
	Version string `json:"version"`
}

type Template

type Template string

func (Template) String

func (t Template) String() string

type Version

type Version string

Jump to

Keyboard shortcuts

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