shared

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2019 License: Apache-2.0 Imports: 16 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)

func Init

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

Init get or creates context, client

func LookupAPIVersion

func LookupAPIVersion(kind string) (string, error)

func Register

func Register(adapter ContractAdapter)

Register register an adapter

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

	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

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)

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