resource

package
v0.0.0-...-3d8ba93 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ResourceType = "resource"

Variables

This section is empty.

Functions

func FromTrait

func FromTrait(from common.ApplicationTrait) (apis.Trait, error)

Types

type Cpu

type Cpu struct {
	Float32 *float32
	String  *string
}

Cpu - Specify the amount of cpu for requests and limits

func Float32AsCpu

func Float32AsCpu(v *float32) Cpu

Float32AsCpu is is a convenience function that returns float32 wrapped in Cpu

func Float32AsCpuOrDefault

func Float32AsCpuOrDefault(v *float32) Cpu

Float32AsCpuOrDefault returns float32 wrapped in Cpu if not nil, or a default value if nil

func StringAsCpu

func StringAsCpu(v *string) Cpu

StringAsCpu is is a convenience function that returns string wrapped in Cpu

func (*Cpu) GetActualInstance

func (obj *Cpu) GetActualInstance() interface{}

Get the actual instance

func (Cpu) MarshalJSON

func (src Cpu) MarshalJSON() ([]byte, error)

Marshal data from the first non-nil pointers in the struct to JSON

func (*Cpu) UnmarshalJSON

func (dst *Cpu) UnmarshalJSON(data []byte) error

Unmarshal JSON data into one of the pointers in the struct

func (*Cpu) Validate

func (o *Cpu) Validate() error

Validate validates this Cpu

type Cpu1

type Cpu1 struct {
	Float32 *float32
	String  *string
}

Cpu1 - Specify the amount of cpu for limits

func Float32AsCpu1

func Float32AsCpu1(v *float32) Cpu1

Float32AsCpu1 is is a convenience function that returns float32 wrapped in Cpu1

func Float32AsCpu1OrDefault

func Float32AsCpu1OrDefault(v *float32) Cpu1

Float32AsCpu1OrDefault returns float32 wrapped in Cpu1 if not nil, or a default value if nil

func StringAsCpu1

func StringAsCpu1(v *string) Cpu1

StringAsCpu1 is is a convenience function that returns string wrapped in Cpu1

func (*Cpu1) GetActualInstance

func (obj *Cpu1) GetActualInstance() interface{}

Get the actual instance

func (Cpu1) MarshalJSON

func (src Cpu1) MarshalJSON() ([]byte, error)

Marshal data from the first non-nil pointers in the struct to JSON

func (*Cpu1) UnmarshalJSON

func (dst *Cpu1) UnmarshalJSON(data []byte) error

Unmarshal JSON data into one of the pointers in the struct

func (*Cpu1) Validate

func (o *Cpu1) Validate() error

Validate validates this Cpu1

type Cpu2

type Cpu2 struct {
	Float32 *float32
	String  *string
}

Cpu2 - Specify the amount of cpu for requests

func Float32AsCpu2

func Float32AsCpu2(v *float32) Cpu2

Float32AsCpu2 is is a convenience function that returns float32 wrapped in Cpu2

func Float32AsCpu2OrDefault

func Float32AsCpu2OrDefault(v *float32) Cpu2

Float32AsCpu2OrDefault returns float32 wrapped in Cpu2 if not nil, or a default value if nil

func StringAsCpu2

func StringAsCpu2(v *string) Cpu2

StringAsCpu2 is is a convenience function that returns string wrapped in Cpu2

func (*Cpu2) GetActualInstance

func (obj *Cpu2) GetActualInstance() interface{}

Get the actual instance

func (Cpu2) MarshalJSON

func (src Cpu2) MarshalJSON() ([]byte, error)

Marshal data from the first non-nil pointers in the struct to JSON

func (*Cpu2) UnmarshalJSON

func (dst *Cpu2) UnmarshalJSON(data []byte) error

Unmarshal JSON data into one of the pointers in the struct

func (*Cpu2) Validate

func (o *Cpu2) Validate() error

Validate validates this Cpu2

type Limits

type Limits struct {
	Cpu *Cpu1 `json:"cpu"`
	// Specify the amount of memory for limits
	Memory *string `json:"memory"`
}

Limits Specify the resources in limits

func NewLimits

func NewLimits() *Limits

NewLimits is short for NewLimitsWithDefault which instantiates a new Limits object. This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set

func NewLimitsEmpty

func NewLimitsEmpty() *Limits

NewLimitsEmpty instantiates a new Limits object with no properties set. This constructor will not assign any default values to properties.

func NewLimitsList

func NewLimitsList(ps ...*Limits) []Limits

NewLimitss converts a list Limits pointers to objects. This is helpful when the SetLimits requires a list of objects

func NewLimitsWith

func NewLimitsWith(cpu Cpu1, memory string) *Limits

NewLimitsWith instantiates a new Limits object This constructor will make sure properties required by API are set. For optional properties, it will set default values if they have been defined. The set of arguments will change when the set of required properties is changed

func NewLimitsWithDefault

func NewLimitsWithDefault() *Limits

NewLimitsWithDefault instantiates a new Limits object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set

func (*Limits) GetCpu

func (o *Limits) GetCpu() Cpu1

GetCpu returns the Cpu field value

func (*Limits) GetCpuOk

func (o *Limits) GetCpuOk() (*Cpu1, bool)

GetCpuOk returns a tuple with the Cpu field value and a boolean to check if the value has been set.

func (*Limits) GetMemory

func (o *Limits) GetMemory() string

GetMemory returns the Memory field value

func (*Limits) GetMemoryOk

func (o *Limits) GetMemoryOk() (*string, bool)

GetMemoryOk returns a tuple with the Memory field value and a boolean to check if the value has been set.

func (Limits) MarshalJSON

func (o Limits) MarshalJSON() ([]byte, error)

func (*Limits) SetCpu

func (o *Limits) SetCpu(v Cpu1) *Limits

SetCpu sets field value

func (*Limits) SetMemory

func (o *Limits) SetMemory(v string) *Limits

SetMemory sets field value

func (Limits) ToMap

func (o Limits) ToMap() (map[string]interface{}, error)

func (*Limits) Validate

func (o *Limits) Validate() error

Validate validates this Limits 1. If the required properties are not set, this will return an error 2. If properties are set, will check if nested required properties are set

type NullableCpu

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

func NewNullableCpu

func NewNullableCpu(val *Cpu) *NullableCpu

func (*NullableCpu) Get

func (v *NullableCpu) Get() *Cpu

func (*NullableCpu) IsSet

func (v *NullableCpu) IsSet() bool

func (NullableCpu) MarshalJSON

func (v NullableCpu) MarshalJSON() ([]byte, error)

func (*NullableCpu) Set

func (v *NullableCpu) Set(val *Cpu)

func (*NullableCpu) UnmarshalJSON

func (v *NullableCpu) UnmarshalJSON(src []byte) error

func (*NullableCpu) Unset

func (v *NullableCpu) Unset()

type NullableCpu1

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

func NewNullableCpu1

func NewNullableCpu1(val *Cpu1) *NullableCpu1

func (*NullableCpu1) Get

func (v *NullableCpu1) Get() *Cpu1

func (*NullableCpu1) IsSet

func (v *NullableCpu1) IsSet() bool

func (NullableCpu1) MarshalJSON

func (v NullableCpu1) MarshalJSON() ([]byte, error)

func (*NullableCpu1) Set

func (v *NullableCpu1) Set(val *Cpu1)

func (*NullableCpu1) UnmarshalJSON

func (v *NullableCpu1) UnmarshalJSON(src []byte) error

func (*NullableCpu1) Unset

func (v *NullableCpu1) Unset()

type NullableCpu2

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

func NewNullableCpu2

func NewNullableCpu2(val *Cpu2) *NullableCpu2

func (*NullableCpu2) Get

func (v *NullableCpu2) Get() *Cpu2

func (*NullableCpu2) IsSet

func (v *NullableCpu2) IsSet() bool

func (NullableCpu2) MarshalJSON

func (v NullableCpu2) MarshalJSON() ([]byte, error)

func (*NullableCpu2) Set

func (v *NullableCpu2) Set(val *Cpu2)

func (*NullableCpu2) UnmarshalJSON

func (v *NullableCpu2) UnmarshalJSON(src []byte) error

func (*NullableCpu2) Unset

func (v *NullableCpu2) Unset()

type NullableLimits

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

func NewNullableLimits

func NewNullableLimits(val *Limits) *NullableLimits

func (*NullableLimits) Get

func (v *NullableLimits) Get() *Limits

func (*NullableLimits) IsSet

func (v *NullableLimits) IsSet() bool

func (NullableLimits) MarshalJSON

func (v NullableLimits) MarshalJSON() ([]byte, error)

func (*NullableLimits) Set

func (v *NullableLimits) Set(val *Limits)

func (*NullableLimits) UnmarshalJSON

func (v *NullableLimits) UnmarshalJSON(src []byte) error

func (*NullableLimits) Unset

func (v *NullableLimits) Unset()

type NullableRequests

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

func NewNullableRequests

func NewNullableRequests(val *Requests) *NullableRequests

func (*NullableRequests) Get

func (v *NullableRequests) Get() *Requests

func (*NullableRequests) IsSet

func (v *NullableRequests) IsSet() bool

func (NullableRequests) MarshalJSON

func (v NullableRequests) MarshalJSON() ([]byte, error)

func (*NullableRequests) Set

func (v *NullableRequests) Set(val *Requests)

func (*NullableRequests) UnmarshalJSON

func (v *NullableRequests) UnmarshalJSON(src []byte) error

func (*NullableRequests) Unset

func (v *NullableRequests) Unset()

type NullableResourceSpec

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

func NewNullableResourceSpec

func NewNullableResourceSpec(val *ResourceSpec) *NullableResourceSpec

func (*NullableResourceSpec) Get

func (*NullableResourceSpec) IsSet

func (v *NullableResourceSpec) IsSet() bool

func (NullableResourceSpec) MarshalJSON

func (v NullableResourceSpec) MarshalJSON() ([]byte, error)

func (*NullableResourceSpec) Set

func (v *NullableResourceSpec) Set(val *ResourceSpec)

func (*NullableResourceSpec) UnmarshalJSON

func (v *NullableResourceSpec) UnmarshalJSON(src []byte) error

func (*NullableResourceSpec) Unset

func (v *NullableResourceSpec) Unset()

type Requests

type Requests struct {
	Cpu *Cpu2 `json:"cpu"`
	// Specify the amount of memory for requests
	Memory *string `json:"memory"`
}

Requests Specify the resources in requests

func NewRequests

func NewRequests() *Requests

NewRequests is short for NewRequestsWithDefault which instantiates a new Requests object. This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set

func NewRequestsEmpty

func NewRequestsEmpty() *Requests

NewRequestsEmpty instantiates a new Requests object with no properties set. This constructor will not assign any default values to properties.

func NewRequestsList

func NewRequestsList(ps ...*Requests) []Requests

NewRequestss converts a list Requests pointers to objects. This is helpful when the SetRequests requires a list of objects

func NewRequestsWith

func NewRequestsWith(cpu Cpu2, memory string) *Requests

NewRequestsWith instantiates a new Requests object This constructor will make sure properties required by API are set. For optional properties, it will set default values if they have been defined. The set of arguments will change when the set of required properties is changed

func NewRequestsWithDefault

func NewRequestsWithDefault() *Requests

NewRequestsWithDefault instantiates a new Requests object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set

func (*Requests) GetCpu

func (o *Requests) GetCpu() Cpu2

GetCpu returns the Cpu field value

func (*Requests) GetCpuOk

func (o *Requests) GetCpuOk() (*Cpu2, bool)

GetCpuOk returns a tuple with the Cpu field value and a boolean to check if the value has been set.

func (*Requests) GetMemory

func (o *Requests) GetMemory() string

GetMemory returns the Memory field value

func (*Requests) GetMemoryOk

func (o *Requests) GetMemoryOk() (*string, bool)

GetMemoryOk returns a tuple with the Memory field value and a boolean to check if the value has been set.

func (Requests) MarshalJSON

func (o Requests) MarshalJSON() ([]byte, error)

func (*Requests) SetCpu

func (o *Requests) SetCpu(v Cpu2) *Requests

SetCpu sets field value

func (*Requests) SetMemory

func (o *Requests) SetMemory(v string) *Requests

SetMemory sets field value

func (Requests) ToMap

func (o Requests) ToMap() (map[string]interface{}, error)

func (*Requests) Validate

func (o *Requests) Validate() error

Validate validates this Requests 1. If the required properties are not set, this will return an error 2. If properties are set, will check if nested required properties are set

type ResourceSpec

type ResourceSpec struct {
	Cpu    *Cpu    `json:"cpu,omitempty"`
	Limits *Limits `json:"limits,omitempty"`
	// Specify the amount of memory for requests and limits
	Memory   *string   `json:"memory,omitempty"`
	Requests *Requests `json:"requests,omitempty"`
}

ResourceSpec struct for ResourceSpec

func NewResourceSpec

func NewResourceSpec() *ResourceSpec

NewResourceSpec is short for NewResourceSpecWithDefault which instantiates a new ResourceSpec object. This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set

func NewResourceSpecEmpty

func NewResourceSpecEmpty() *ResourceSpec

NewResourceSpecEmpty instantiates a new ResourceSpec object with no properties set. This constructor will not assign any default values to properties.

func NewResourceSpecList

func NewResourceSpecList(ps ...*ResourceSpec) []ResourceSpec

NewResourceSpecs converts a list ResourceSpec pointers to objects. This is helpful when the SetResourceSpec requires a list of objects

func NewResourceSpecWith

func NewResourceSpecWith() *ResourceSpec

NewResourceSpecWith instantiates a new ResourceSpec object This constructor will make sure properties required by API are set. For optional properties, it will set default values if they have been defined. The set of arguments will change when the set of required properties is changed

func NewResourceSpecWithDefault

func NewResourceSpecWithDefault() *ResourceSpec

NewResourceSpecWithDefault instantiates a new ResourceSpec object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set

func (ResourceSpec) MarshalJSON

func (o ResourceSpec) MarshalJSON() ([]byte, error)

func (ResourceSpec) ToMap

func (o ResourceSpec) ToMap() (map[string]interface{}, error)

type ResourceTrait

type ResourceTrait struct {
	Base       apis.TraitBase
	Properties ResourceSpec
}

func Resource

func Resource() *ResourceTrait

func (*ResourceTrait) Build

func (*ResourceTrait) DefType

func (r *ResourceTrait) DefType() string

func (*ResourceTrait) FromTrait

func (r *ResourceTrait) FromTrait(from common.ApplicationTrait) (*ResourceTrait, error)

func (*ResourceTrait) GetCpu

func (o *ResourceTrait) GetCpu() Cpu

GetCpu returns the Cpu field value if set, zero value otherwise.

func (*ResourceTrait) GetCpuOk

func (o *ResourceTrait) GetCpuOk() (*Cpu, bool)

GetCpuOk returns a tuple with the Cpu field value if set, nil otherwise and a boolean to check if the value has been set.

func (*ResourceTrait) GetLimits

func (o *ResourceTrait) GetLimits() Limits

GetLimits returns the Limits field value if set, zero value otherwise.

func (*ResourceTrait) GetLimitsOk

func (o *ResourceTrait) GetLimitsOk() (*Limits, bool)

GetLimitsOk returns a tuple with the Limits field value if set, nil otherwise and a boolean to check if the value has been set.

func (*ResourceTrait) GetMemory

func (o *ResourceTrait) GetMemory() string

GetMemory returns the Memory field value if set, zero value otherwise.

func (*ResourceTrait) GetMemoryOk

func (o *ResourceTrait) GetMemoryOk() (*string, bool)

GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise and a boolean to check if the value has been set.

func (*ResourceTrait) GetRequests

func (o *ResourceTrait) GetRequests() Requests

GetRequests returns the Requests field value if set, zero value otherwise.

func (*ResourceTrait) GetRequestsOk

func (o *ResourceTrait) GetRequestsOk() (*Requests, bool)

GetRequestsOk returns a tuple with the Requests field value if set, nil otherwise and a boolean to check if the value has been set.

func (*ResourceTrait) HasCpu

func (o *ResourceTrait) HasCpu() bool

HasCpu returns a boolean if a field has been set.

func (*ResourceTrait) HasLimits

func (o *ResourceTrait) HasLimits() bool

HasLimits returns a boolean if a field has been set.

func (*ResourceTrait) HasMemory

func (o *ResourceTrait) HasMemory() bool

HasMemory returns a boolean if a field has been set.

func (*ResourceTrait) HasRequests

func (o *ResourceTrait) HasRequests() bool

HasRequests returns a boolean if a field has been set.

func (*ResourceTrait) SetCpu

func (o *ResourceTrait) SetCpu(v Cpu) *ResourceTrait

SetCpu gets a reference to the given Cpu and assigns it to the cpu field. Cpu:

func (*ResourceTrait) SetLimits

func (o *ResourceTrait) SetLimits(v Limits) *ResourceTrait

SetLimits gets a reference to the given Limits and assigns it to the limits field. Limits:

func (*ResourceTrait) SetMemory

func (o *ResourceTrait) SetMemory(v string) *ResourceTrait

SetMemory gets a reference to the given string and assigns it to the memory field. Memory: Specify the amount of memory for requests and limits

func (*ResourceTrait) SetRequests

func (o *ResourceTrait) SetRequests(v Requests) *ResourceTrait

SetRequests gets a reference to the given Requests and assigns it to the requests field. Requests:

func (*ResourceTrait) Validate

func (o *ResourceTrait) Validate() error

Validate validates this ResourceSpec 1. If the required properties are not set, this will return an error 2. If properties are set, will check if nested required properties are set

Jump to

Keyboard shortcuts

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