shared

package
v0.58.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRoutes

func BuildRoutes(service interface{}, apiPrefix string) ([]*endly.Route, error)

BuildRoutes build routes

func BuildRoutesWithPrefix added in v0.31.0

func BuildRoutesWithPrefix(service interface{}, apiPrefix, actionPrefix string) ([]*endly.Route, error)

func Init

func Init(context *endly.Context, rawRequest map[string]interface{}) error

Init get or creates context, client

func IsNotFound added in v0.31.0

func IsNotFound(candidate interface{}) bool

IsNotFound returns true if error is not found

func LookupAPIVersion

func LookupAPIVersion(kind string) (string, error)

func LookupAPIVersions added in v0.31.0

func LookupAPIVersions(kind string) ([]string, error)

func MatchedMetaTypes added in v0.31.0

func MatchedMetaTypes(kinds ...string) []string

MatchedMetaTypes returns matched kinds

func MetaTypes added in v0.31.0

func MetaTypes() []string

MetaTypes returns meta types

func Register

func Register(adapter ContractAdapter)

Register register an adapter

func ResourceListToInterface added in v0.33.0

func ResourceListToInterface(target, source interface{}) error

func TextToQuantity added in v0.33.0

func TextToQuantity(target, source interface{}) error

func ToSelector added in v0.33.0

func ToSelector(selectorMap map[string]string) string

ToSelector returns selector

Types

type ContractAdapter

type ContractAdapter interface {
	SetService(service interface{}) error
	Call() (result interface{}, err error)
	GetId() string
}

ContractAdapter represents a contract adapter

func Get

func Get(id string) (ContractAdapter, bool)

Get returns contract adapter

type CtxClient

type CtxClient struct {
	CredConfig *cred.Config

	Namespace   string
	ResetConfig *rest.Config

	RawRequest map[string]interface{}
	// contains filtered or unexported fields
}

CtxClient represents generic google cloud service client

func GetCtxClient

func GetCtxClient(context *endly.Context) (*CtxClient, error)

GetCtxClient get or creates a new kubernetess client.

func (*CtxClient) Clientset

func (c *CtxClient) Clientset() (*kubernetes.Clientset, error)

func (*CtxClient) ConfigPath

func (c *CtxClient) ConfigPath() string

func (*CtxClient) EndpointIP added in v0.33.0

func (c *CtxClient) EndpointIP() string

type KindMethodMeta

type KindMethodMeta struct {
	metav1.TypeMeta
	Method string
}

func NewKindMethodMeta

func NewKindMethodMeta(id string) *KindMethodMeta

type KindOperations

type KindOperations struct {
	metav1.TypeMeta
	Methods map[string]ContractAdapter
}

func Lookup

func Lookup(apiVersion, kind string) (*KindOperations, error)

Lookup returns KindOperations with all defined operations or error

func (*KindOperations) Lookup

func (r *KindOperations) Lookup(method string) (ContractAdapter, error)

func (*KindOperations) NewRequest added in v0.31.0

func (r *KindOperations) NewRequest(method string, requestData interface{}) (interface{}, error)

type NotFound added in v0.31.0

type NotFound struct {
	Message string
}

NotFound represents not found error

func (*NotFound) Error added in v0.31.0

func (f *NotFound) Error() string

type OutputEvent

type OutputEvent struct {
	Message string
	Tag     string
	Value   interface{}
}

func NewOutputEvent

func NewOutputEvent(message string, tag string, value interface{}) *OutputEvent

func (*OutputEvent) Messages

func (e *OutputEvent) Messages() []*msg.Message

Jump to

Keyboard shortcuts

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