aip132

package
v0.0.0-...-58a4e20 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package aip132 contains utilities used to comply with API Improvement Proposals (AIPs) from https://google.aip.dev/132.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldPath

type FieldPath struct {
	// contains filtered or unexported fields
}

FieldPath represents the path to a field in a message.

For example, for the given message:

message MyThing {
   message Bar {
       string foobar = 2;
   }
   string foo = 1;
   Bar bar = 2;
   map<string, Bar> named_bars = 3;
}

Some valid paths would be: foo, bar.foobar and named_bars.`bar-key`.foobar.

func NewFieldPath

func NewFieldPath(segments ...string) FieldPath

NewFieldPath initializes a new field path with the given segments.

func (FieldPath) Equals

func (f FieldPath) Equals(other FieldPath) bool

Equals returns iff two field paths refer to exactly the same field.

func (FieldPath) GetSegments

func (f FieldPath) GetSegments() []string

func (FieldPath) String

func (f FieldPath) String() string

String returns a canonical representation of the field path, following AIP-132 / AIP-161 syntax.

type OrderBy

type OrderBy struct {
	// The field path. This is the path of the field in the
	// resource message that the AIP-132 List RPC is listing.
	FieldPath FieldPath
	// Whether the field should be sorted in descending order.
	Descending bool
}

OrderBy represents a part of an AIP-132 order_by clause.

func ParseOrderBy

func ParseOrderBy(text string) ([]OrderBy, error)

ParseOrderBy parses an AIP-132 order_by list. The method validates the syntax is correct and each identifier appears at most once, but it does not validate the identifiers themselves are valid.

Jump to

Keyboard shortcuts

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