Documentation ¶
Index ¶
- Constants
- 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)
- func (m *Identifier) GetApplicationName() string
- func (m *Identifier) GetResourceId() string
- func (m *Identifier) GetResourceType() string
- func (m Identifier) MarshalJSONPB(*jsonpb.Marshaler) ([]byte, error)
- func (m Identifier) MarshalText() (text []byte, err error)
- func (*Identifier) ProtoMessage()
- func (m *Identifier) Reset()
- func (m *Identifier) String() string
- func (m *Identifier) UnmarshalJSONPB(_ *jsonpb.Unmarshaler, data []byte) error
- func (m *Identifier) XXX_DiscardUnknown()
- func (m *Identifier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Identifier) XXX_Merge(src proto.Message)
- func (m *Identifier) XXX_Size() int
- func (m *Identifier) XXX_Unmarshal(b []byte) error
Constants ¶
const (
// Delimiter of Resource Reference according to Atlas Reference format
Delimiter = "/"
)
Variables ¶
This section is empty.
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" json:"application_name,omitempty"` // An application specific type name of a resource ResourceType string `protobuf:"bytes,2,opt,name=resource_type,json=resourceType" json:"resource_type,omitempty"` // An application specific resource identity of a resource ResourceId string `protobuf:"bytes,3,opt,name=resource_id,json=resourceId" json:"resource_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
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 ¶
func (*Identifier) Descriptor() ([]byte, []int)
func (*Identifier) GetApplicationName ¶
func (m *Identifier) GetApplicationName() string
func (*Identifier) GetResourceId ¶
func (m *Identifier) GetResourceId() string
func (*Identifier) GetResourceType ¶
func (m *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) Reset ¶
func (m *Identifier) Reset()
func (*Identifier) String ¶
func (m *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.
func (*Identifier) XXX_DiscardUnknown ¶
func (m *Identifier) XXX_DiscardUnknown()
func (*Identifier) XXX_Marshal ¶
func (m *Identifier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Identifier) XXX_Merge ¶
func (dst *Identifier) XXX_Merge(src proto.Message)
func (*Identifier) XXX_Size ¶
func (m *Identifier) XXX_Size() int
func (*Identifier) XXX_Unmarshal ¶
func (m *Identifier) XXX_Unmarshal(b []byte) error