utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildOutOfClusterConfig

func BuildOutOfClusterConfig() (*rest.Config, error)

BuildOutOfClusterConfig returns k8s config

func CreateNatsTriggerCustomResource

func CreateNatsTriggerCustomResource(kubelessClient versioned.Interface, natsTrigger *natsApi.NATSTrigger) error

CreateNatsTriggerCustomResource will create a custom function object

func DeleteNatsTriggerCustomResource

func DeleteNatsTriggerCustomResource(kubelessClient versioned.Interface, natsTriggerName, ns string) error

DeleteNatsTriggerCustomResource will delete custom function object

func GetClient

func GetClient() kubernetes.Interface

GetClient returns a k8s clientset to the request from inside of cluster

func GetFunctionPort

func GetFunctionPort(clientset kubernetes.Interface, namespace, functionName string) (string, error)

GetFunctionPort returns the port for a function service

func GetHTTPReq

func GetHTTPReq(clientset kubernetes.Interface, funcName, namespace, eventNamespace, method, body string) (*http.Request, error)

GetHTTPReq returns the http request object that can be used to send a event with payload to function service

func GetKubelessClientOutCluster

func GetKubelessClientOutCluster() (versioned.Interface, error)

GetKubelessClientOutCluster returns kubeless clientset to make kubeless API request from outside of cluster

func GetNatsTriggerCustomResource

func GetNatsTriggerCustomResource(kubelessClient versioned.Interface, natsTriggerName, ns string) (*natsApi.NATSTrigger, error)

GetNatsTriggerCustomResource will get CronJobTrigger custom resource object

func GetTriggerClientInCluster

func GetTriggerClientInCluster() (versioned.Interface, error)

GetTriggerClientInCluster returns function clientset to the request from inside of cluster

func IsJSON

func IsJSON(s string) bool

IsJSON returns true if the string is json

func SendMessage

func SendMessage(req *http.Request) error

SendMessage sends messge over function service

func UpdateNatsTriggerCustomResource

func UpdateNatsTriggerCustomResource(kubelessClient versioned.Interface, natsTrigger *natsApi.NATSTrigger) error

UpdateNatsTriggerCustomResource applies changes to the function custom object

Types

This section is empty.

Jump to

Keyboard shortcuts

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