Documentation ¶
Index ¶
- Constants
- Variables
- func AttributesAnyOf(a, b Attributes) bool
- func AttributesSubsetOf(a, b Attributes) bool
- type Attribute
- func (*Attribute) Descriptor() ([]byte, []int)
- func (m *Attribute) Equal(rhs *Attribute) bool
- func (m *Attribute) Marshal() (dAtA []byte, err error)
- func (m *Attribute) MarshalTo(dAtA []byte) (int, error)
- func (m *Attribute) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Attribute) ProtoMessage()
- func (m *Attribute) Reset()
- func (m *Attribute) Size() (n int)
- func (m *Attribute) String() string
- func (m Attribute) SubsetOf(rhs Attribute) bool
- func (m *Attribute) Unmarshal(dAtA []byte) error
- func (m *Attribute) XXX_DiscardUnknown()
- func (m *Attribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Attribute) XXX_Merge(src proto.Message)
- func (m *Attribute) XXX_Size() int
- func (m *Attribute) XXX_Unmarshal(b []byte) error
- type AttributeValue
- type Attributes
- func (attr Attributes) AnyIN(group AttributesGroup) bool
- func (attr Attributes) AnyOf(b Attributes) bool
- func (attr Attributes) Dup() Attributes
- func (attr Attributes) Find(glob string) AttributeValue
- func (attr Attributes) GetCapabilitiesGroup(prefix string) AttributesGroup
- func (attr Attributes) GetCapabilitiesMap(prefix string) AttributesGroup
- func (attr Attributes) IN(group AttributesGroup) bool
- func (attr Attributes) Iterate(prefix string, fn func(group, key, value string))
- func (attr Attributes) Len() int
- func (attr Attributes) Less(i, j int) bool
- func (attr Attributes) SubsetOf(b Attributes) bool
- func (attr Attributes) Swap(i, j int)
- func (attr Attributes) Validate() error
- func (attr Attributes) ValidateWithRegex(r *regexp.Regexp) error
- type AttributesGroup
- type PlacementRequirements
- func (*PlacementRequirements) Descriptor() ([]byte, []int)
- func (m PlacementRequirements) Dup() PlacementRequirements
- func (m *PlacementRequirements) Marshal() (dAtA []byte, err error)
- func (m *PlacementRequirements) MarshalTo(dAtA []byte) (int, error)
- func (m *PlacementRequirements) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PlacementRequirements) ProtoMessage()
- func (m *PlacementRequirements) Reset()
- func (m *PlacementRequirements) Size() (n int)
- func (m *PlacementRequirements) String() string
- func (m *PlacementRequirements) Unmarshal(dAtA []byte) error
- func (m *PlacementRequirements) XXX_DiscardUnknown()
- func (m *PlacementRequirements) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PlacementRequirements) XXX_Merge(src proto.Message)
- func (m *PlacementRequirements) XXX_Size() int
- func (m *PlacementRequirements) XXX_Unmarshal(b []byte) error
- type SignedBy
- func (*SignedBy) Descriptor() ([]byte, []int)
- func (m *SignedBy) Marshal() (dAtA []byte, err error)
- func (m *SignedBy) MarshalTo(dAtA []byte) (int, error)
- func (m *SignedBy) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SignedBy) ProtoMessage()
- func (m *SignedBy) Reset()
- func (m *SignedBy) Size() (n int)
- func (m *SignedBy) String() string
- func (m *SignedBy) Unmarshal(dAtA []byte) error
- func (m *SignedBy) XXX_DiscardUnknown()
- func (m *SignedBy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SignedBy) XXX_Merge(src proto.Message)
- func (m *SignedBy) XXX_Size() int
- func (m *SignedBy) XXX_Unmarshal(b []byte) error
Constants ¶
const ( AttributeNameRegexpStringWildcard = `^([a-zA-Z][\w\/\.\-]{1,126}[\w\*]?)$` AttributeNameRegexpString = `^([a-zA-Z][\w\/\.\-]{1,126})$` )
Variables ¶
Functions ¶
func AttributesAnyOf ¶
func AttributesAnyOf(a, b Attributes) bool
func AttributesSubsetOf ¶
func AttributesSubsetOf(a, b Attributes) bool
AttributesSubsetOf check if a is subset of b nolint: gofmt For example there are two yaml files being converted into these attributes example 1: a is subset of b --- // a attributes:
region: - us-east-1
--- b attributes:
region: - us-east-1 - us-east-2
example 2: a is not subset of b attributes:
region: - us-east-1
--- b attributes:
region: - us-east-2 - us-east-3
example 3: a is subset of b attributes:
region: - us-east-2 - us-east-3
--- b attributes:
region: - us-east-2
Types ¶
type Attribute ¶
type Attribute struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty" yaml:"key"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty" yaml:"value"` }
Attribute represents key value pair
func (*Attribute) MarshalToSizedBuffer ¶
func (*Attribute) XXX_Marshal ¶
type AttributeValue ¶
type Attributes ¶
type Attributes []Attribute
Attributes purpose of using this type in favor of Cosmos's sdk.Attribute is ability to later extend it with operators to support querying on things like cpu/memory/storage attributes At this moment type though is same as sdk.Attributes but all akash libraries were turned to use a new one
func (Attributes) AnyIN ¶
func (attr Attributes) AnyIN(group AttributesGroup) bool
func (Attributes) AnyOf ¶
func (attr Attributes) AnyOf(b Attributes) bool
func (Attributes) Dup ¶
func (attr Attributes) Dup() Attributes
func (Attributes) Find ¶
func (attr Attributes) Find(glob string) AttributeValue
func (Attributes) GetCapabilitiesGroup ¶
func (attr Attributes) GetCapabilitiesGroup(prefix string) AttributesGroup
GetCapabilitiesGroup
example capabilities/storage/1/persistent: true capabilities/storage/1/class: io1 capabilities/storage/2/persistent: false
nolint: gofmt returns
- - persistent: true class: nvme
- - persistent: false
func (Attributes) GetCapabilitiesMap ¶
func (attr Attributes) GetCapabilitiesMap(prefix string) AttributesGroup
func (Attributes) IN ¶
func (attr Attributes) IN(group AttributesGroup) bool
IN check if given attributes are in attributes group AttributesGroup for storage
- persistent: true class: beta1
- persistent: true class: beta2
that
- persistent: true class: beta1
func (Attributes) Iterate ¶
func (attr Attributes) Iterate(prefix string, fn func(group, key, value string))
func (Attributes) Len ¶
func (attr Attributes) Len() int
func (Attributes) Less ¶
func (attr Attributes) Less(i, j int) bool
func (Attributes) SubsetOf ¶
func (attr Attributes) SubsetOf(b Attributes) bool
func (Attributes) Swap ¶
func (attr Attributes) Swap(i, j int)
func (Attributes) Validate ¶
func (attr Attributes) Validate() error
func (Attributes) ValidateWithRegex ¶
func (attr Attributes) ValidateWithRegex(r *regexp.Regexp) error
type AttributesGroup ¶
type AttributesGroup []Attributes
type PlacementRequirements ¶
type PlacementRequirements struct { // SignedBy list of keys that tenants expect to have signatures from SignedBy SignedBy `protobuf:"bytes,1,opt,name=signed_by,json=signedBy,proto3" json:"signed_by" yaml:"signed_by"` // Attribute list of attributes tenant expects from the provider Attributes Attributes `protobuf:"bytes,2,rep,name=attributes,proto3,castrepeated=Attributes" json:"attributes" yaml:"attributes"` }
PlacementRequirements
func (*PlacementRequirements) Descriptor ¶
func (*PlacementRequirements) Descriptor() ([]byte, []int)
func (PlacementRequirements) Dup ¶
func (m PlacementRequirements) Dup() PlacementRequirements
func (*PlacementRequirements) Marshal ¶
func (m *PlacementRequirements) Marshal() (dAtA []byte, err error)
func (*PlacementRequirements) MarshalTo ¶
func (m *PlacementRequirements) MarshalTo(dAtA []byte) (int, error)
func (*PlacementRequirements) MarshalToSizedBuffer ¶
func (m *PlacementRequirements) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PlacementRequirements) ProtoMessage ¶
func (*PlacementRequirements) ProtoMessage()
func (*PlacementRequirements) Reset ¶
func (m *PlacementRequirements) Reset()
func (*PlacementRequirements) Size ¶
func (m *PlacementRequirements) Size() (n int)
func (*PlacementRequirements) String ¶
func (m *PlacementRequirements) String() string
func (*PlacementRequirements) Unmarshal ¶
func (m *PlacementRequirements) Unmarshal(dAtA []byte) error
func (*PlacementRequirements) XXX_DiscardUnknown ¶
func (m *PlacementRequirements) XXX_DiscardUnknown()
func (*PlacementRequirements) XXX_Marshal ¶
func (m *PlacementRequirements) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PlacementRequirements) XXX_Merge ¶
func (m *PlacementRequirements) XXX_Merge(src proto.Message)
func (*PlacementRequirements) XXX_Size ¶
func (m *PlacementRequirements) XXX_Size() int
func (*PlacementRequirements) XXX_Unmarshal ¶
func (m *PlacementRequirements) XXX_Unmarshal(b []byte) error
type SignedBy ¶
type SignedBy struct { // all_of all keys in this list must have signed attributes AllOf []string `protobuf:"bytes,1,rep,name=all_of,json=allOf,proto3" json:"all_of" yaml:"allOf"` // any_of at least of of the keys from the list must have signed attributes AnyOf []string `protobuf:"bytes,2,rep,name=any_of,json=anyOf,proto3" json:"any_of" yaml:"anyOf"` }
SignedBy represents validation accounts that tenant expects signatures for provider attributes AllOf has precedence i.e. if there is at least one entry AnyOf is ignored regardless to how many entries there this behaviour to be discussed