vtadminproto

package
v0.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package vtadminproto provides helper functions for working with vtadminpb protobuf types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnnotateClusterSpan added in v0.10.0

func AnnotateClusterSpan(c *vtadminpb.Cluster, span trace.Span)

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".

Types

type Tablets added in v0.10.0

type Tablets []*vtadminpb.Tablet

Tablets is a list of Tablet protobuf objects.

func (Tablets) AliasStringList added in v0.10.0

func (tablets Tablets) AliasStringList() []string

AliasStringList returns a list of TabletAlias strings for each tablet in the list.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL