platform

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Added   EventType = "Added"
	Updated EventType = "Updated"
	Deleted EventType = "Deleted"

	Pending ServiceStatus = "Pending"
	Running ServiceStatus = "Running"
	Unknown ServiceStatus = "Unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BrowserSpec

type BrowserSpec struct {
	BrowserName    string             `yaml:"-" json:"-"`
	BrowserVersion string             `yaml:"-" json:"-"`
	Image          string             `yaml:"image" json:"image"`
	Path           string             `yaml:"path" json:"path"`
	Privileged     *bool              `yaml:"privileged" json:"privileged"`
	Meta           Meta               `yaml:"meta" json:"meta"`
	Spec           Spec               `yaml:"spec" json:"spec"`
	Volumes        []apiv1.Volume     `yaml:"volumes,omitempty" json:"volumes,omitempty"`
	Capabilities   []apiv1.Capability `yaml:"kernelCaps,omitempty" json:"kernelCaps,omitempty"`
	RunAs          RunAsOptions       `yaml:"runAs,omitempty" json:"runAs,omitempty"`
}

BrowserSpec describes settings for Service

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client ...

func (*Client) Quota added in v1.0.2

func (cl *Client) Quota() QuotaInterface

func (*Client) Service added in v1.0.2

func (cl *Client) Service() ServiceInterface

func (*Client) State added in v1.0.2

func (cl *Client) State() (PlatformState, error)

List ...

func (*Client) Watch

func (cl *Client) Watch() <-chan Event

Watch ...

type ClientConfig

type ClientConfig struct {
	Namespace           string
	Service             string
	ServicePort         string
	ImagePullSecretName string
	ProxyImage          string
	ReadinessTimeout    time.Duration
	IdleTimeout         time.Duration
}

ClientConfig ...

type Event

type Event struct {
	Type           EventType
	PlatformObject interface{}
}

Event ...

type EventType

type EventType string

EventType ...

type Meta

type Meta struct {
	Labels      map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`
	Annotations map[string]string `yaml:"annotations,omitempty" json:"annotations,omitempty"`
}

Meta describes standart metadata

type Platform

type Platform interface {
	Service() ServiceInterface
	Quota() QuotaInterface
	State() (PlatformState, error)
	Watch() <-chan Event
}

Platform ...

func NewClient

func NewClient(c ClientConfig) (Platform, error)

NewClient ...

type PlatformState added in v1.0.2

type PlatformState struct {
	Services []Service
	Workers  []Worker
}

type Quota added in v1.0.2

type Quota struct {
	Name            string `json:"name"`
	CurrentMaxLimit int64  `json:"totalLimit"`
}

type QuotaInterface added in v1.0.2

type QuotaInterface interface {
	Create(int64) (Quota, error)
	Get() (Quota, error)
	Update(int64) (Quota, error)
}

type RunAsOptions added in v1.0.2

type RunAsOptions struct {
	RunAsUser  *int64 `yaml:"uid,omitempty" json:"uid,omitempty"`
	RunAsGroup *int64 `yaml:"gid,omitempty" json:"gid,omitempty"`
}

type Service

type Service struct {
	SessionID  string            `json:"id"`
	URL        *url.URL          `json:"-"`
	Labels     map[string]string `json:"labels"`
	OnTimeout  chan struct{}     `json:"-"`
	CancelFunc func()            `json:"-"`
	Status     ServiceStatus     `json:"-"`
	Started    time.Time         `json:"started"`
	Uptime     string            `json:"uptime"`
}

Service ...

type ServiceInterface added in v1.0.2

type ServiceInterface interface {
	Create(ServiceSpec) (Service, error)
	Delete(string) error
	Logs(context.Context, string) (io.ReadCloser, error)
}

type ServiceSpec

type ServiceSpec struct {
	SessionID             string
	RequestedCapabilities selenium.Capabilities
	Template              BrowserSpec
}

ServiceSpec describes data requred for creating service

type ServiceStatus

type ServiceStatus string

ServiceStatus ...

type Spec

type Spec struct {
	Resources    apiv1.ResourceRequirements `yaml:"resources,omitempty" json:"resources,omitempty"`
	HostAliases  []apiv1.HostAlias          `yaml:"hostAliases,omitempty" json:"hostAliases,omitempty"`
	EnvVars      []apiv1.EnvVar             `yaml:"env,omitempty" json:"env,omitempty"`
	NodeSelector map[string]string          `yaml:"nodeSelector,omitempty" json:"nodeSelector,omitempty"`
	Affinity     apiv1.Affinity             `yaml:"affinity,omitempty" json:"affinity,omitempty"`
	DNSConfig    apiv1.PodDNSConfig         `yaml:"dnsConfig,omitempty" json:"dnsConfig,omitempty"`
	Tolerations  []apiv1.Toleration         `yaml:"tolerations,omitempty" json:"tolerations,omitempty"`
	VolumeMounts []apiv1.VolumeMount        `yaml:"volumeMounts,omitempty" json:"volumeMounts,omitempty"`
}

Spec describes specification for Service

type Worker added in v1.0.2

type Worker struct {
	Name    string            `json:"name"`
	Labels  map[string]string `json:"labels"`
	Status  ServiceStatus     `json:"-"`
	Started time.Time         `json:"started"`
	Uptime  string            `json:"uptime"`
}

Jump to

Keyboard shortcuts

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