Documentation
¶
Index ¶
- Constants
- Variables
- func BuildString(aname, rtype, rid string) string
- func Nil(id *Identifier) (ok bool)
- func ParseString(id string) (aname, rtype, rid string)
- type Identifier
- func (*Identifier) Descriptor() ([]byte, []int)deprecated
- func (x *Identifier) GetApplicationName() string
- func (x *Identifier) GetResourceId() string
- func (x *Identifier) GetResourceType() string
- func (m Identifier) MarshalJSONPB(*jsonpb.Marshaler) ([]byte, error)
- func (m Identifier) MarshalText() (text []byte, err error)
- func (*Identifier) ProtoMessage()
- func (x *Identifier) ProtoReflect() protoreflect.Message
- func (x *Identifier) Reset()
- func (x *Identifier) String() string
- func (m *Identifier) UnmarshalJSONPB(_ *jsonpb.Unmarshaler, data []byte) error
Constants ¶
const (
// Delimiter of Resource Reference according to Atlas Reference format
Delimiter = "/"
)
Variables ¶
var File_resource_proto protoreflect.FileDescriptor
Functions ¶
func BuildString ¶
BuildString builds string id according to Atlas Reference format:
<application_name>/<resource_type>/<resource_id>
func Nil ¶ added in v0.10.0
func Nil(id *Identifier) (ok bool)
Nil reports whether id is empty identifier or not. The id is empty if it is either nil or could be converted to the empty string by its String method.
func ParseString ¶
ParseString parses id according to Atlas Reference format:
<application_name>/<resource_type>/<resource_id>
All leading and trailing Delimiter are removed. The resource_id is parsed first, then resource type and last application name. The id "/a/b/c/" will be converted to "a/b/c" and returned as (a, b, c). The id "b/c/" will be converted to "b/c" and returned as ("", b, c).
Types ¶
type Identifier ¶
type Identifier struct { // An application identifier that will be used among // other infrastructure services to identify the application ApplicationName string `protobuf:"bytes,1,opt,name=application_name,json=applicationName,proto3" json:"application_name,omitempty"` // An application specific type name of a resource ResourceType string `protobuf:"bytes,2,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` // An application specific resource identity of a resource ResourceId string `protobuf:"bytes,3,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"` // contains filtered or unexported fields }
A number of application services require a mechanism to encode the identity of a particular resource across applications. The resource identifiers consist of the application ID, an application-defined resource type, and an application-defined ID for that resource
func (*Identifier) Descriptor
deprecated
func (*Identifier) Descriptor() ([]byte, []int)
Deprecated: Use Identifier.ProtoReflect.Descriptor instead.
func (*Identifier) GetApplicationName ¶
func (x *Identifier) GetApplicationName() string
func (*Identifier) GetResourceId ¶
func (x *Identifier) GetResourceId() string
func (*Identifier) GetResourceType ¶
func (x *Identifier) GetResourceType() string
func (Identifier) MarshalJSONPB ¶
func (m Identifier) MarshalJSONPB(*jsonpb.Marshaler) ([]byte, error)
MarshalJSONPB implements jsonpb.JSONPBMarshaler interface by marshal Identifier from a JSON string in accordance with Atlas Reference format
<application_name>/<resource_type>/<resource_id>
Support "null" value.
func (Identifier) MarshalText ¶ added in v0.7.0
func (m Identifier) MarshalText() (text []byte, err error)
func (*Identifier) ProtoMessage ¶
func (*Identifier) ProtoMessage()
func (*Identifier) ProtoReflect ¶ added in v0.24.3
func (x *Identifier) ProtoReflect() protoreflect.Message
func (*Identifier) Reset ¶
func (x *Identifier) Reset()
func (*Identifier) String ¶
func (x *Identifier) String() string
func (*Identifier) UnmarshalJSONPB ¶
func (m *Identifier) UnmarshalJSONPB(_ *jsonpb.Unmarshaler, data []byte) error
UnmarshalJSONPB implements jsonpb.JSONPBUnmarshaler interface by unmarshal Identifier to a JSON string in accordance with Atlas Reference format
<application_name>/<resource_type>/<resource_id>
Support "null" value.