common

package
v0.0.0-...-9be0976 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

SharedK8sClient is service internal global use

Functions

func HandleDockerCfgJSONContent

func HandleDockerCfgJSONContent(username, password, email, server string) ([]byte, error)

HandleDockerCfgJSONContent serializes a ~/.docker/config.json file

func RuntimeObjectToInstanceObj

func RuntimeObjectToInstanceObj(obj runtime.Object, targetObj interface{}) error

Types

type DefaultImplWorkloadsResourceHandler

type DefaultImplWorkloadsResourceHandler struct {
	GroupVersionResource schema.GroupVersionResource
}

func (*DefaultImplWorkloadsResourceHandler) Apply

func (d *DefaultImplWorkloadsResourceHandler) Apply(namespace string, name string, obj *unstructured.Unstructured) (
	result *unstructured.Unstructured, isUpdate bool, retryErr error)

func (*DefaultImplWorkloadsResourceHandler) Delete

func (d *DefaultImplWorkloadsResourceHandler) Delete(namespace, name string) error

func (*DefaultImplWorkloadsResourceHandler) Get

func (d *DefaultImplWorkloadsResourceHandler) Get(namespace, name string, subresources ...string) (
	runtime.Object, error,
)

func (*DefaultImplWorkloadsResourceHandler) GetGroupVersionResource

func (*DefaultImplWorkloadsResourceHandler) List

func (d *DefaultImplWorkloadsResourceHandler) List(
	namespace,
	flag string,
	pos,
	size int64,
	selector interface{},
) (*unstructured.UnstructuredList, error)

func (*DefaultImplWorkloadsResourceHandler) Patch

func (d *DefaultImplWorkloadsResourceHandler) Patch(namespace, name string, pathData map[string]interface{}) (*unstructured.Unstructured, error)

func (*DefaultImplWorkloadsResourceHandler) SetGroupVersionResource

func (d *DefaultImplWorkloadsResourceHandler) SetGroupVersionResource(g schema.GroupVersionResource)

func (*DefaultImplWorkloadsResourceHandler) SharedNamespaceList

func (d *DefaultImplWorkloadsResourceHandler) SharedNamespaceList(namespace string, selector interface{}) (*unstructured.UnstructuredList, error)

func (*DefaultImplWorkloadsResourceHandler) Watch

func (d *DefaultImplWorkloadsResourceHandler) Watch(
	namespace string,
	resourceVersion string,
	timeoutSeconds int64,
	selector interface{},
) (<-chan watch.Event, error)

type DockerConfig

type DockerConfig map[string]DockerConfigEntry

DockerConfig represents the config file used by the docker CLI. This config that represents the credentials that should be used when pulling images from specific image repositories.

type DockerConfigEntry

type DockerConfigEntry struct {
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
	Email    string `json:"email,omitempty"`
	Auth     string `json:"auth,omitempty"`
}

type DockerConfigJSON

type DockerConfigJSON struct {
	Auths DockerConfig `json:"auths"`
	// +optional
	HttpHeaders map[string]string `json:"HttpHeaders,omitempty"`
}

DockerConfigJSON represents a local docker auth config file for pulling images.

type ResourceApply

type ResourceApply interface {
	Apply(namespace, name string, obj *unstructured.Unstructured) (*unstructured.Unstructured, bool, error)
	Patch(namespace, name string, patchData map[string]interface{}) (*unstructured.Unstructured, error)
	Delete(namespace, name string) error
}

ResourceApply update resource interface

type ResourceQuery

type ResourceQuery interface {
	List(namespace, flag string, pos, size int64, selector interface{}) (*unstructured.UnstructuredList, error)
	Get(namespace, name string, subresources ...string) (runtime.Object, error)
	SharedNamespaceList(namespace string, selector interface{}) (*unstructured.UnstructuredList, error)
	Watch(namespace string, resourceVersion string, timeoutSeconds int64, selector interface{}) (<-chan watch.Event, error)
}

ResourceQuery query resource interface

type WorkloadsResourceHandler

type WorkloadsResourceHandler interface {
	ResourceQuery
	ResourceApply
	WorkloadsResourceVersion
}

WorkloadsResourceHandler all needed interface defined

type WorkloadsResourceVersion

type WorkloadsResourceVersion interface {
	SetGroupVersionResource(schema.GroupVersionResource)
	GetGroupVersionResource() schema.GroupVersionResource
}

type WorkloadsSlice

type WorkloadsSlice []*fv1.Workloads

WorkloadsSlice query resource results

func (WorkloadsSlice) Len

func (w WorkloadsSlice) Len() int

func (WorkloadsSlice) Less

func (w WorkloadsSlice) Less(i, j int) bool

func (WorkloadsSlice) Swap

func (w WorkloadsSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

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