Documentation ¶
Index ¶
- type Client
- func (c *Client) GetFunctions(ctx context.Context, namespace string) ([]types.FunctionStatus, error)
- func (c *Client) GetNamespaces(ctx context.Context) ([]string, error)
- func (c *Client) HasNamespaceSupport(ctx context.Context) (bool, error)
- func (c *Client) InvokeAsync(ctx context.Context, name string, payload []byte) (bool, error)
- func (c *Client) InvokeSync(ctx context.Context, name string, payload []byte) ([]byte, error)
- type Controller
- type FunctionCrawler
- type FunctionFetcher
- type FunctionMapBuilder
- type Invoker
- type NamespaceFetcher
- type TopicFunctionCache
- type TopicMap
- type TopicMapBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is used for interacting with Open FaaS
func NewClient ¶
NewClient creates a new instance of an OpenFaaS Client using the provided informations
func (*Client) GetFunctions ¶
func (c *Client) GetFunctions(ctx context.Context, namespace string) ([]types.FunctionStatus, error)
GetFunctions TODO:
func (*Client) GetNamespaces ¶
GetNamespaces TODO:
func (*Client) HasNamespaceSupport ¶
HasNamespaceSupport TODO:
func (*Client) InvokeAsync ¶
InvokeAsync TODO:
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is responsible for building up and maintaining a Cache with all of the deployed OpenFaaS Functions across all namespaces
func NewController ¶
func NewController(conf *config.Controller, client FunctionCrawler) *Controller
NewController returns a new instance
func (*Controller) Invoke ¶
func (c *Controller) Invoke(topic string, message []byte)
Invoke triggers a call to all functions registered to the specified topic
func (*Controller) Start ¶
func (c *Controller) Start(ctx context.Context)
Start setups the cache and starts continous caching
type FunctionCrawler ¶
type FunctionCrawler interface { NamespaceFetcher FunctionFetcher Invoker }
FunctionCrawler defines interfaces required to crawl OpenFaaS for functions
type FunctionFetcher ¶
type FunctionFetcher interface {
GetFunctions(ctx context.Context, namespace string) ([]types.FunctionStatus, error)
}
FunctionFetcher defines interface to explore deployed function of an OpenFaaS installation.
type FunctionMapBuilder ¶
type FunctionMapBuilder struct {
// contains filtered or unexported fields
}
FunctionMapBuilder convienient construct to build a map of function <=> topic
func NewFunctionMapBuilder ¶
func NewFunctionMapBuilder() *FunctionMapBuilder
NewFunctionMapBuilder returns a new instance with an empty build target
func (*FunctionMapBuilder) Append ¶
func (b *FunctionMapBuilder) Append(topic string, function string)
Append the provided function to the specified topic
func (*FunctionMapBuilder) Build ¶
func (b *FunctionMapBuilder) Build() map[string][]string
Build returns a map containing values based on privous Append calls
type Invoker ¶
type Invoker interface { InvokeSync(ctx context.Context, name string, payload []byte) ([]byte, error) InvokeAsync(ctx context.Context, name string, payload []byte) (bool, error) }
Invoker defines interfaces that invoke deployed OpenFaaS Functions.
type NamespaceFetcher ¶
type NamespaceFetcher interface { HasNamespaceSupport(ctx context.Context) (bool, error) GetNamespaces(ctx context.Context) ([]string, error) }
NamespaceFetcher defines interfaces to explore namespaces of an OpenFaaS installation.
type TopicFunctionCache ¶
type TopicFunctionCache struct {
// contains filtered or unexported fields
}
TopicFunctionCache TODO:
func NewTopicFunctionCache ¶
func NewTopicFunctionCache() *TopicFunctionCache
NewTopicFunctionCache return a new instance
func (*TopicFunctionCache) GetCachedValues ¶
func (m *TopicFunctionCache) GetCachedValues(name string) []string
GetCachedValues TODO:
func (*TopicFunctionCache) Refresh ¶
func (m *TopicFunctionCache) Refresh(update map[string][]string)
Refresh TODO: