utils

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MergePatchType is patch type
	MergePatchType = "application/merge-patch+json"
	// ResourceTypeDevices is plural of device resource in apiserver
	ResourceTypeDevices = "devices"
)

Variables

This section is empty.

Functions

func AddDeviceCrds

func AddDeviceCrds(scheme *runtime.Scheme) error

func GetTimeStamp

func GetTimeStamp() string

func NewCRDClient

func NewCRDClient(MasterAdress, KubeConfigPath string) (*rest.RESTClient, error)

NewCRDClient is used to create a restClient for crd

Types

type Device

type Device struct {
	Status    ke.DeviceStatus `json:"status"`
	DeviceID  string          `json:"-"`
	Namespace string          `json:"-"`

	FSM      *fsm.FSM `json:"-"`
	Filename string
	Url      string
	// contains filtered or unexported fields
}

func (*Device) AddDesiredArg

func (s *Device) AddDesiredArg(arg string)

func (*Device) AddDesiredJob

func (s *Device) AddDesiredJob(job string)

func (*Device) GetStatus

func (s *Device) GetStatus() string

func (*Device) InitDevice

func (s *Device) InitDevice(id, ns string, crdClient *rest.RESTClient) error

func (*Device) Launch

func (s *Device) Launch(filename, url string)

func (*Device) PatchStatus

func (s *Device) PatchStatus() ([]byte, error)

func (*Device) SyncStatus

func (s *Device) SyncStatus() error

type K8SConfig

type K8SConfig struct {
	MasterAdress   string
	KubeConfigPath string
	QPS            float32
	Burst          int
	ContentType    string
}

func NewK8SConfig

func NewK8SConfig(MasterAdress, KubeConfigPath string) K8SConfig

func (*K8SConfig) Generate

func (k *K8SConfig) Generate() (conf *rest.Config, err error)

Jump to

Keyboard shortcuts

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