Documentation ¶
Overview ¶
Package vtadminproto provides helper functions for working with vtadminpb protobuf types.
Index ¶
- func AnnotateClusterSpan(c *vtadminpb.Cluster, span trace.Span)
- func AnnotateSpanWithGetSchemaTableSizeOptions(opts *vtadminpb.GetSchemaTableSizeOptions, span trace.Span)
- func FilterTablets(condition func(tablet *vtadminpb.Tablet) bool, tablets []*vtadminpb.Tablet, ...) []*vtadminpb.Tablet
- func ParseTabletServingState(state string) vtadminpb.Tablet_ServingState
- func TabletServingStateString(state vtadminpb.Tablet_ServingState) string
- type Tablets
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnotateClusterSpan ¶ added in v0.10.0
AnnotateClusterSpan adds the cluster_id and cluster_name to a span.
func AnnotateSpanWithGetSchemaTableSizeOptions ¶ added in v0.10.0
func AnnotateSpanWithGetSchemaTableSizeOptions(opts *vtadminpb.GetSchemaTableSizeOptions, span trace.Span)
AnnotateSpanWithGetSchemaTableSizeOptions adds the aggregate_table_sizes to a span. It is a noop if the size options object is nil.
func FilterTablets ¶ added in v0.10.0
func FilterTablets(condition func(tablet *vtadminpb.Tablet) bool, tablets []*vtadminpb.Tablet, maxResults int) []*vtadminpb.Tablet
FilterTablets returns a subset of tablets (not exceeding maxResults) that satisfy the given condition.
If maxResults is negative, len(tablets) is used instead.
func ParseTabletServingState ¶
func ParseTabletServingState(state string) vtadminpb.Tablet_ServingState
ParseTabletServingState returns a ServingState value from the given string. If the string does not map to a valid value, this function returns UNKNOWN.
func TabletServingStateString ¶
func TabletServingStateString(state vtadminpb.Tablet_ServingState) string
TabletServingStateString returns a ServingState represented as a string. If the state does not map to a valid value, this function returns "UNKNOWN".