Documentation ¶
Index ¶
- Constants
- func MakeServerlessBackend(kubeClientset kubernetes.Interface, kubeConfig *rest.Config, cfg *types.Config) types.ServerlessBackend
- type FakeBackend
- func (f *FakeBackend) AddError(functionName string, err error)
- func (f *FakeBackend) CreateService(service types.Service) error
- func (f *FakeBackend) DeleteService(service types.Service) error
- func (f *FakeBackend) GetInfo() *types.ServerlessBackendInfo
- func (f *FakeBackend) GetKubeClientset() kubernetes.Interface
- func (f *FakeBackend) GetProxyDirector(serviceName string) func(req *http.Request)
- func (f *FakeBackend) ListServices() ([]*types.Service, error)
- func (f *FakeBackend) ReadService(name string) (*types.Service, error)
- func (f *FakeBackend) UpdateService(service types.Service) error
- type KnativeBackend
- func (kn *KnativeBackend) CreateService(service types.Service) error
- func (kn *KnativeBackend) DeleteService(service types.Service) error
- func (kn *KnativeBackend) GetInfo() *types.ServerlessBackendInfo
- func (kn *KnativeBackend) GetKubeClientset() kubernetes.Interface
- func (kn *KnativeBackend) GetProxyDirector(serviceName string) func(req *http.Request)
- func (kn *KnativeBackend) ListServices() ([]*types.Service, error)
- func (kn *KnativeBackend) ReadService(name string) (*types.Service, error)
- func (kn *KnativeBackend) UpdateService(service types.Service) error
- type KubeBackend
- func (k *KubeBackend) CreateService(service types.Service) error
- func (k *KubeBackend) DeleteService(service types.Service) error
- func (k *KubeBackend) GetInfo() *types.ServerlessBackendInfo
- func (k *KubeBackend) GetKubeClientset() kubernetes.Interface
- func (k *KubeBackend) ListServices() ([]*types.Service, error)
- func (k *KubeBackend) ReadService(name string) (*types.Service, error)
- func (k *KubeBackend) UpdateService(service types.Service) error
- type OpenfaasBackend
- func (of *OpenfaasBackend) CreateService(service types.Service) error
- func (of *OpenfaasBackend) DeleteService(service types.Service) error
- func (of *OpenfaasBackend) GetInfo() *types.ServerlessBackendInfo
- func (of *OpenfaasBackend) GetKubeClientset() kubernetes.Interface
- func (of *OpenfaasBackend) GetProxyDirector(serviceName string) func(req *http.Request)
- func (of *OpenfaasBackend) ListServices() ([]*types.Service, error)
- func (of *OpenfaasBackend) ReadService(name string) (*types.Service, error)
- func (of *OpenfaasBackend) StartScaler()
- func (of *OpenfaasBackend) UpdateService(service types.Service) error
Constants ¶
const ConfigMapNameOSCAR = "additional-oscar-config"
Variables ¶
This section is empty.
Functions ¶
func MakeServerlessBackend ¶
func MakeServerlessBackend(kubeClientset kubernetes.Interface, kubeConfig *rest.Config, cfg *types.Config) types.ServerlessBackend
MakeServerlessBackend returns a ServerlessBackend based on the configuration
Types ¶
type FakeBackend ¶
type FakeBackend struct {
// contains filtered or unexported fields
}
FakeBackend fake struct to mock the beahaviour of the ServerlessBackend interface
func MakeFakeBackend ¶
func MakeFakeBackend() *FakeBackend
MakeFakeBackend returns the pointer of a new FakeBackend struct
func MakeFakeSyncBackend ¶
func MakeFakeSyncBackend() *FakeBackend
MakeFakeSyncBackend returns the pointer of a new FakeSyncBackend struct
func (*FakeBackend) AddError ¶
func (f *FakeBackend) AddError(functionName string, err error)
AddError append an error to the specified function
func (*FakeBackend) CreateService ¶
func (f *FakeBackend) CreateService(service types.Service) error
CreateService creates a new service as a k8s podTemplate (fake)
func (*FakeBackend) DeleteService ¶
func (f *FakeBackend) DeleteService(service types.Service) error
DeleteService deletes a service (fake)
func (*FakeBackend) GetInfo ¶
func (f *FakeBackend) GetInfo() *types.ServerlessBackendInfo
GetInfo returns the ServerlessBackendInfo with the name and version (fake)
func (*FakeBackend) GetKubeClientset ¶
func (f *FakeBackend) GetKubeClientset() kubernetes.Interface
GetKubeClientset returns the Kubernetes Clientset (fake)
func (*FakeBackend) GetProxyDirector ¶
func (f *FakeBackend) GetProxyDirector(serviceName string) func(req *http.Request)
GetProxyDirector returns the ProxyDirector (fake)
func (*FakeBackend) ListServices ¶
func (f *FakeBackend) ListServices() ([]*types.Service, error)
ListServices returns a slice with all services registered in the provided namespace (fake)
func (*FakeBackend) ReadService ¶
func (f *FakeBackend) ReadService(name string) (*types.Service, error)
ReadService returns a Service (fake)
func (*FakeBackend) UpdateService ¶
func (f *FakeBackend) UpdateService(service types.Service) error
UpdateService updates an existent service (fake)
type KnativeBackend ¶
type KnativeBackend struct {
// contains filtered or unexported fields
}
KnativeBackend struct to represent a Knative client
func MakeKnativeBackend ¶
func MakeKnativeBackend(kubeClientset kubernetes.Interface, kubeConfig *rest.Config, cfg *types.Config) *KnativeBackend
MakeKnativeBackend makes a KnativeBackend from the provided k8S clientset and config
func (*KnativeBackend) CreateService ¶
func (kn *KnativeBackend) CreateService(service types.Service) error
CreateService creates a new service as a Knative service
func (*KnativeBackend) DeleteService ¶
func (kn *KnativeBackend) DeleteService(service types.Service) error
DeleteService deletes a service
func (*KnativeBackend) GetInfo ¶
func (kn *KnativeBackend) GetInfo() *types.ServerlessBackendInfo
GetInfo returns the ServerlessBackendInfo with the name and version
func (*KnativeBackend) GetKubeClientset ¶
func (kn *KnativeBackend) GetKubeClientset() kubernetes.Interface
GetKubeClientset returns the Kubernetes Clientset
func (*KnativeBackend) GetProxyDirector ¶
func (kn *KnativeBackend) GetProxyDirector(serviceName string) func(req *http.Request)
GetProxyDirector returns a director function to use in a httputil.ReverseProxy
func (*KnativeBackend) ListServices ¶
func (kn *KnativeBackend) ListServices() ([]*types.Service, error)
ListServices returns a slice with all services registered in the provided namespace
func (*KnativeBackend) ReadService ¶
func (kn *KnativeBackend) ReadService(name string) (*types.Service, error)
ReadService returns a Service
func (*KnativeBackend) UpdateService ¶
func (kn *KnativeBackend) UpdateService(service types.Service) error
UpdateService updates an existent service
type KubeBackend ¶
type KubeBackend struct {
// contains filtered or unexported fields
}
KubeBackend struct to represent a Kubernetes client to store services as podTemplates
func MakeKubeBackend ¶
func MakeKubeBackend(kubeClientset kubernetes.Interface, cfg *types.Config) *KubeBackend
MakeKubeBackend makes a KubeBackend with the provided k8s clientset
func (*KubeBackend) CreateService ¶
func (k *KubeBackend) CreateService(service types.Service) error
CreateService creates a new service as a k8s podTemplate
func (*KubeBackend) DeleteService ¶
func (k *KubeBackend) DeleteService(service types.Service) error
DeleteService deletes a service
func (*KubeBackend) GetInfo ¶
func (k *KubeBackend) GetInfo() *types.ServerlessBackendInfo
GetInfo returns the ServerlessBackendInfo with the name and version
func (*KubeBackend) GetKubeClientset ¶
func (k *KubeBackend) GetKubeClientset() kubernetes.Interface
GetKubeClientset returns the Kubernetes Clientset
func (*KubeBackend) ListServices ¶
func (k *KubeBackend) ListServices() ([]*types.Service, error)
ListServices returns a slice with all services registered in the provided namespace
func (*KubeBackend) ReadService ¶
func (k *KubeBackend) ReadService(name string) (*types.Service, error)
ReadService returns a Service
func (*KubeBackend) UpdateService ¶
func (k *KubeBackend) UpdateService(service types.Service) error
UpdateService updates an existent service
type OpenfaasBackend ¶
type OpenfaasBackend struct {
// contains filtered or unexported fields
}
OpenfaasBackend struct to represent an Openfaas client
func MakeOpenfaasBackend ¶
func MakeOpenfaasBackend(kubeClientset kubernetes.Interface, kubeConfig *rest.Config, cfg *types.Config) *OpenfaasBackend
MakeOpenfaasBackend makes a OpenfaasBackend from the provided k8S clientset and config
func (*OpenfaasBackend) CreateService ¶
func (of *OpenfaasBackend) CreateService(service types.Service) error
CreateService creates a new service as a OpenFaaS function
func (*OpenfaasBackend) DeleteService ¶
func (of *OpenfaasBackend) DeleteService(service types.Service) error
DeleteService deletes a service
func (*OpenfaasBackend) GetInfo ¶
func (of *OpenfaasBackend) GetInfo() *types.ServerlessBackendInfo
GetInfo returns the ServerlessBackendInfo with the name and version
func (*OpenfaasBackend) GetKubeClientset ¶
func (of *OpenfaasBackend) GetKubeClientset() kubernetes.Interface
GetKubeClientset returns the Kubernetes Clientset
func (*OpenfaasBackend) GetProxyDirector ¶
func (of *OpenfaasBackend) GetProxyDirector(serviceName string) func(req *http.Request)
GetProxyDirector returns a director function to use in a httputil.ReverseProxy
func (*OpenfaasBackend) ListServices ¶
func (of *OpenfaasBackend) ListServices() ([]*types.Service, error)
ListServices returns a slice with all services registered in the provided namespace
func (*OpenfaasBackend) ReadService ¶
func (of *OpenfaasBackend) ReadService(name string) (*types.Service, error)
ReadService returns a Service
func (*OpenfaasBackend) StartScaler ¶
func (of *OpenfaasBackend) StartScaler()
StartScaler starts the OpenFaaS Scaler
func (*OpenfaasBackend) UpdateService ¶
func (of *OpenfaasBackend) UpdateService(service types.Service) error
UpdateService updates an existent service