Documentation
¶
Overview ¶
Package runtime implements connectors to various runtimes.
Index ¶
- Constants
- func Install(name string, runtime Runtime)
- type Event
- type EventUpdate
- type KubeconfigSource
- type QueryOption
- func WithCluster(cluster *common.Cluster) QueryOption
- func WithContext(name string) QueryOption
- func WithCurrentVersion(version string) QueryOption
- func WithFieldSelector(selector string) QueryOption
- func WithLabelSelector(selector string) QueryOption
- func WithName(name string) QueryOption
- func WithNamespace(namespace string) QueryOption
- func WithNodes(nodes ...string) QueryOption
- func WithResource(resource string) QueryOption
- type QueryOptions
- type Resource
- type Runtime
Constants ¶
const DefaultClient = "default"
DefaultClient defines default client id.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EventUpdate ¶
type EventUpdate struct {
Old interface{} `json:"old"`
New interface{} `json:"new"`
}
EventUpdate spec for update event.
type KubeconfigSource ¶ added in v0.2.1
type KubeconfigSource interface {
GetKubeconfig(context.Context, *common.Context) (*rest.Config, error)
}
KubeconfigSource is implemented by runtimes that allow getting kubeconfigs.
type QueryOption ¶
type QueryOption func(*QueryOptions)
QueryOption defines variable input option for List and Get methods in the Runtime implementations.
func WithCluster ¶
func WithCluster(cluster *common.Cluster) QueryOption
WithCluster specifies the cluster to use to get the resource from.
func WithContext ¶
func WithContext(name string) QueryOption
WithContext routes the request to a specific context.
func WithCurrentVersion ¶
func WithCurrentVersion(version string) QueryOption
WithCurrentVersion pass current version to the update call to avoid conflicts (only for update, Theila only).
func WithFieldSelector ¶
func WithFieldSelector(selector string) QueryOption
WithFieldSelector enables filtering by field.
func WithLabelSelector ¶
func WithLabelSelector(selector string) QueryOption
WithLabelSelector enables filtering by label.
func WithNamespace ¶
func WithNamespace(namespace string) QueryOption
WithNamespace enables filtering by namespace.
func WithNodes ¶
func WithNodes(nodes ...string) QueryOption
WithNodes explicitly defines nodes list to use for the request (Talos only).
func WithResource ¶
func WithResource(resource string) QueryOption
WithResource explicitly specifies the resource type to get from the runtime.
type QueryOptions ¶
type QueryOptions struct {
Cluster *common.Cluster
Namespace string
Name string
Context string
Resource string
LabelSelector string
FieldSelector string
CurrentVersion string
Nodes []string
}
QueryOptions List and Get query options.
func NewQueryOptions ¶
func NewQueryOptions(setters ...QueryOption) *QueryOptions
NewQueryOptions creates new QueryOptions.
type Resource ¶
type Resource struct {
Metadata map[string]interface{} `yaml:"metadata" json:"metadata"`
Spec map[string]interface{} `yaml:"spec" json:"spec"`
Resource resource.Resource `yaml:"-" json:"-"`
ID string `yaml:"-" json:"-"`
}
Resource wraps Talos and COSI resource response to be encoded as JSON.
type Runtime ¶
type Runtime interface {
Watch(context.Context, *message.WatchSpec, chan Event) error
Get(context.Context, ...QueryOption) (interface{}, error)
List(context.Context, ...QueryOption) ([]interface{}, error)
Create(context.Context, cosiresource.Resource, ...QueryOption) error
Update(context.Context, cosiresource.Resource, ...QueryOption) error
Delete(context.Context, ...QueryOption) error
AddContext(string, []byte) error
GetContext(context.Context, *common.Context, *common.Cluster) ([]byte, error)
}
Runtime is an abstraction for the data access.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package kubernetes implements the connector that can pull data from the Kubernetes control plane.
|
Package kubernetes implements the connector that can pull data from the Kubernetes control plane. |
|
capi
Package capi contains capi util helpers specific to Theila.
|
Package capi contains capi util helpers specific to Theila. |
|
Package talos implements the connector that can pull data from the Talos controller runtime.
|
Package talos implements the connector that can pull data from the Talos controller runtime. |
|
Package theila implements the internal service runtime.
|
Package theila implements the internal service runtime. |
|
controllers
Package controllers contains all Theila internal COSI runtime controllers.
|
Package controllers contains all Theila internal COSI runtime controllers. |
|
resources
Package resources defines various internal Theila resources.
|
Package resources defines various internal Theila resources. |