types

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MPL-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedType is returned if the type is not implemented
	ErrUnsupportedType = errors.New("unsupported type")
)

Functions

This section is empty.

Types

type LifecycleHook added in v0.3.0

type LifecycleHook map[string][]string

func (*LifecycleHook) UnmarshalJSON added in v0.3.0

func (l *LifecycleHook) UnmarshalJSON(data []byte) error

type Option added in v0.3.0

type Option struct {
	// DisplayName of the option, preferred over the option name by a supporting tool.
	DisplayName string `json:"displayName,omitempty"`

	// A description of the option displayed to the user by a supporting tool.
	Description string `json:"description,omitempty"`

	// If required is true and the user doesn't supply a value, devpod will ask the user
	Required bool `json:"required,omitempty"`

	// If true, will not show the value to the user
	Password bool `json:"password,omitempty"`

	// Type is the provider option type. Can be one of: string, multiline, duration, number or boolean. Defaults to string
	Type string `json:"type,omitempty"`

	// ValidationPattern is a regex pattern to validate the value
	ValidationPattern string `json:"validationPattern,omitempty"`

	// ValidationMessage is the message that appears if the user enters an invalid option
	ValidationMessage string `json:"validationMessage,omitempty"`

	// Suggestions are suggestions to show in the DevPod UI for this option
	Suggestions []string `json:"suggestions,omitempty"`

	// Allowed values for this option.
	Enum OptionEnumArray `json:"enum,omitempty"`

	// Hidden specifies if the option should be hidden
	Hidden bool `json:"hidden,omitempty"`

	// Local means the variable is not resolved immediately and instead later when the workspace / machine was created.
	Local bool `json:"local,omitempty"`

	// Global means the variable is stored globally. By default, option values will be
	// saved per machine or workspace instead.
	Global bool `json:"global,omitempty"`

	// Default value if the user omits this option from their configuration.
	Default string `json:"default,omitempty"`

	// Cache is the duration to cache the value before rerunning the command
	Cache string `json:"cache,omitempty"`

	// Command is the command to run to specify an option
	Command string `json:"command,omitempty"`

	// SubOptionsCommand is the command to run to fetch sub options
	SubOptionsCommand string `json:"subOptionsCommand,omitempty"`

	// Mutable specifies if an option can be changed on the workspace or machine after creating it
	Mutable bool `json:"mutable,omitempty"`
}

type OptionEnum added in v0.5.19

type OptionEnum struct {
	Value       string `json:"value,omitempty"`
	DisplayName string `json:"displayName,omitempty"`
}

type OptionEnumArray added in v0.5.19

type OptionEnumArray []OptionEnum

func (*OptionEnumArray) UnmarshalJSON added in v0.5.19

func (e *OptionEnumArray) UnmarshalJSON(data []byte) error

type StrArray

type StrArray []string

StrArray string array to be used on JSON UnmarshalJSON

func (*StrArray) UnmarshalJSON

func (sa *StrArray) UnmarshalJSON(data []byte) error

UnmarshalJSON convert JSON object array of string or a string format strings to a golang string array

type StrBool

type StrBool string

func (*StrBool) Bool added in v0.5.20

func (s *StrBool) Bool() (bool, error)

func (*StrBool) UnmarshalJSON

func (s *StrBool) UnmarshalJSON(data []byte) error

UnmarshalJSON parses fields that may be numbers or booleans.

type StrIntArray

type StrIntArray []string

StrIntArray string array to be used on JSON UnmarshalJSON

func (*StrIntArray) UnmarshalJSON

func (sa *StrIntArray) UnmarshalJSON(data []byte) error

UnmarshalJSON convert JSON object array of string or a string format strings to a golang string array

type Streams added in v0.5.21

type Streams struct {
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

type Time

type Time struct {
	time.Time `protobuf:"-"`
}

Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.

+protobuf.options.marshal=false +protobuf.as=Timestamp +protobuf.options.(gogoproto.goproto_stringer)=false

func Date

func Date(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) Time

Date returns the Time corresponding to the supplied parameters by wrapping time.Date.

func NewTime

func NewTime(time time.Time) Time

NewTime returns a wrapped instance of the provided time

func Now

func Now() Time

Now returns the current local time.

func Unix

func Unix(sec int64, nsec int64) Time

Unix returns the local time corresponding to the given Unix time by wrapping time.Unix.

func (*Time) Before

func (t *Time) Before(u *Time) bool

Before reports whether the time instant t is before u.

func (*Time) DeepCopyInto

func (t *Time) DeepCopyInto(out *Time)

DeepCopyInto creates a deep-copy of the Time value. The underlying time.Time type is effectively immutable in the time API, so it is safe to copy-by-assign, despite the presence of (unexported) Pointer fields.

func (*Time) Equal

func (t *Time) Equal(u *Time) bool

Equal reports whether the time instant t is equal to u.

func (*Time) IsZero

func (t *Time) IsZero() bool

IsZero returns true if the value is nil or time is zero.

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (Time) MarshalQueryParameter

func (t Time) MarshalQueryParameter() (string, error)

MarshalQueryParameter converts to a URL query parameter value

func (Time) OpenAPISchemaFormat

func (Time) OpenAPISchemaFormat() string

OpenAPISchemaFormat is used by the kube-openapi generator when constructing the OpenAPI spec of this type.

func (Time) OpenAPISchemaType

func (Time) OpenAPISchemaType() []string

OpenAPISchemaType is used by the kube-openapi generator when constructing the OpenAPI spec of this type.

See: https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators

func (Time) Rfc3339Copy

func (t Time) Rfc3339Copy() Time

Rfc3339Copy returns a copy of the Time at second-level precision.

func (Time) ToUnstructured

func (t Time) ToUnstructured() interface{}

ToUnstructured implements the value.UnstructuredConverter interface.

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaller interface.

func (*Time) UnmarshalQueryParameter

func (t *Time) UnmarshalQueryParameter(str string) error

UnmarshalQueryParameter converts from a URL query parameter value to an object

Jump to

Keyboard shortcuts

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