diplomat v0.9.3 Diplomat.Key
Link to this section Summary
Functions
Creates a new Diplomat.Key
from a path. The path should be either a list
with two elements or a list of lists of two elements. Each two element list
represents a segment of the key path
Creates a new Diplomat.Key
from a Diplomat.Proto.Key
struct
Determines whether or not a Key
is incomplete. This is most useful when
figuring out whether or not we must first call the API to allocate an ID for
the associated entity
Creates a new Diplomat.Key
from a kind
Creates a new Diplomat.Key
form a kind and a name
Creates a new Diplomat.Key
from a kind, an id or name, and a parent Entity
Generates a path list ffor a given key. The path identifies the Enity’s
location nested within another Diplomat.Entity
Convert a Diplomat.Key
to its protobuf struct
Link to this section Types
t() :: %Diplomat.Key{id: integer | nil, kind: String.t, name: String.t | nil, namespace: String.t | nil, parent: Diplomat.Key.t | nil, project_id: String.t | nil}
A Key for uniquely identifying a Diplomat.Entity
.
A Key must have a unique identifier, which is either a name
or an id
.
Most often, if setting a unique identifier manually, you will use the name
field. However, if neither a name nor an id is defined, Diplomat
will
auto-assign an id by calling the API to allocate an id for the Key
.
Link to this section Functions
from_allocate_ids_proto(Diplomat.Proto.AllocateIdsResponse.t) :: [t]
from_commit_proto(Diplomat.Proto.CommitResponse.t) :: [t]
Creates a new Diplomat.Key
from a path. The path should be either a list
with two elements or a list of lists of two elements. Each two element list
represents a segment of the key path.
Creates a new Diplomat.Key
from a Diplomat.Proto.Key
struct
Determines whether or not a Key
is incomplete. This is most useful when
figuring out whether or not we must first call the API to allocate an ID for
the associated entity.
Creates a new Diplomat.Key
from a kind
Creates a new Diplomat.Key
form a kind and a name
Creates a new Diplomat.Key
from a kind, an id or name, and a parent Entity
Generates a path list ffor a given key. The path identifies the Enity’s
location nested within another Diplomat.Entity
.
Convert a Diplomat.Key
to its protobuf struct.
It should be noted that this function does not convert the struct to its
binary representation, but instead returns a Diplomat.Proto.Key
struct
(which is later converted to the binary format).