Documentation ¶
Index ¶
- Variables
- type Name
- func (tn Name) BaseNameString() string
- func (tn Name) FullName() string
- func (tn Name) IsRoot() bool
- func (tn Name) Parent(degree int) (Name, error)
- func (tn Name) Partition() int
- func (tn Name) Root() Name
- func (tn Name) VersionSet() string
- func (tn Name) WithPartition(partition int) Name
- func (tn Name) WithVersionSet(versionSet string) Name
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoParent = errors.New("root task queue partition has no parent") ErrInvalidDegree = errors.New("invalid task queue partition branching degree") )
Functions ¶
This section is empty.
Types ¶
type Name ¶
type Name struct {
// contains filtered or unexported fields
}
Name encapsulates all the name mangling we do for task queues.
Users work with "high-level task queues" and can give them arbitrary names (except for our prefix).
Each high-level task queue corresponds to one or more "low-level task queues", each of which has a distinct task queue manager in memory in matching service, as well as a distinct identity in persistence.
There are two pieces of identifying information for low-level task queues: a partition index, and a version set identifier. All low-level task queues have a partition index, which may be 0. Partition 0 is called the "root". The version set identifier is optional: task queues with it are called "versioned" and task queues without it are called "unversioned".
All versioned low-level task queues use mangled names. All unversioned low-level task queues with non-zero partition also use mangled names.
Mangled names look like this:
/_sys/<base name>/[<version set id>:]<partition id>
The partition id is required, and the version set id is optional. If present, it is separated from the partition id by a colon. This scheme lets users use anything they like for a base name, except for strings starting with "/_sys/", without ambiguity.
For backward compatibility, unversioned low-level task queues with partition 0 do not use mangled names, they use the bare base name.
func FromBaseName ¶
FromBaseName takes a base name and returns a Name. Returns an error if name looks like a mangled name.
func Parse ¶
Parse takes a mangled low-level task queue name and returns a Name. Returns an error if the given name is not a valid mangled name.
func (Name) BaseNameString ¶
BaseNameString returns the base name for a task queue. This should be used when looking up settings in dynamic config, and pretty much nowhere else. To get the name of the root partition, use tn.Root().FullName().
func (Name) FullName ¶
FullName returns the mangled name of the task queue, to be used in RPCs and persistence.
func (Name) Parent ¶
Parent returns a Name for the parent partition, using the given branching degree.
func (Name) VersionSet ¶
VersionSet returns the version set for a task queue.
func (Name) WithPartition ¶
WithPartition returns a new Name with the same base and version set but a different partition.
func (Name) WithVersionSet ¶
WithVersionSet returns a new Name with the same base and partition but a different version set.