util

package
v0.30.4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EtagLiteral added in v0.22.0

func EtagLiteral(s string) string

func FindResourceField added in v0.4.1

func HasEtagField added in v0.22.0

func HasEtagField(m protoreflect.MessageDescriptor) bool

func HasFieldAnnotation added in v0.22.0

func HasFieldAnnotation(field protoreflect.FieldDescriptor, annotation annotations.FieldBehavior) bool

func HasMutableResourceReferences

func HasMutableResourceReferences(message protoreflect.MessageDescriptor) bool

func HasParent

func HasParent(r *annotations.ResourceDescriptor) bool

func HasRequiredEtagField added in v0.22.0

func HasRequiredEtagField(m protoreflect.MessageDescriptor) bool

func HasRequiredFields

func HasRequiredFields(message protoreflect.MessageDescriptor) bool

func HasUpdateMask added in v0.1.5

func HasUpdateMask(method protoreflect.MethodDescriptor) bool

func IsAlternativeBatch added in v0.4.0

func IsAlternativeBatch(method protoreflect.MethodDescriptor) bool

func IsAlternativeBatchDelete added in v0.4.0

func IsAlternativeBatchDelete(method protoreflect.MethodDescriptor) bool

func IsAlternativeBatchGet

func IsAlternativeBatchGet(method protoreflect.MethodDescriptor) bool

func PathChainGet

func PathChainGet(p protopath.Path) string

func RangeRequiredFields

func RangeRequiredFields(
	message protoreflect.MessageDescriptor,
	f func(protopath.Path, protoreflect.FieldDescriptor),
)

func ReturnsEmpty added in v0.24.1

func ReturnsEmpty(method protoreflect.MethodDescriptor) bool

func ReturnsLRO

func ReturnsLRO(method protoreflect.MethodDescriptor) bool

func StandardMethod

func StandardMethod(
	service *protogen.Service,
	r *annotations.ResourceDescriptor,
	methodType aipreflect.MethodType,
) (*protogen.Method, bool)

func WildcardResourceName added in v0.8.0

func WildcardResourceName(r *annotations.ResourceDescriptor) string

Types

type MethodBatchGet

type MethodBatchGet struct {
	Resource *annotations.ResourceDescriptor
	Method   *protogen.Method

	Parent string
	Names  []string
}

func (MethodBatchGet) Generate

func (m MethodBatchGet) Generate(f *protogen.GeneratedFile, response, err, assign string)

type MethodCreate

type MethodCreate struct {
	Resource *annotations.ResourceDescriptor
	Method   *protogen.Method

	Parent         string
	Message        string
	UserSettableID string
}

func (MethodCreate) Generate

func (m MethodCreate) Generate(f *protogen.GeneratedFile, response, err, assign string)

type MethodDelete

type MethodDelete struct {
	Resource *annotations.ResourceDescriptor
	Method   *protogen.Method

	ResourceVar string // variable name of the resource.
	Name        string
	Etag        string
}

func (MethodDelete) Generate

func (m MethodDelete) Generate(f *protogen.GeneratedFile, response, err, assign string)

type MethodGet

type MethodGet struct {
	Resource *annotations.ResourceDescriptor
	Method   *protogen.Method

	Name string
}

func (MethodGet) Generate

func (m MethodGet) Generate(f *protogen.GeneratedFile, response, err, assign string)

type MethodList

type MethodList struct {
	Resource *annotations.ResourceDescriptor
	Method   *protogen.Method

	Parent    string
	PageSize  string
	PageToken string
}

func (MethodList) Generate

func (m MethodList) Generate(f *protogen.GeneratedFile, response, err, assign string)

type MethodSearch

type MethodSearch struct {
	Resource *annotations.ResourceDescriptor
	Method   *protogen.Method

	Parent    string
	PageSize  string
	PageToken string
}

func (MethodSearch) Generate

func (m MethodSearch) Generate(f *protogen.GeneratedFile, response, err, assign string)

type MethodUpdate

type MethodUpdate struct {
	Resource *annotations.ResourceDescriptor
	Method   *protogen.Method

	// set either Parent + Name, or Msg
	Name       string
	Parent     string
	Msg        string
	UpdateMask []string
	Etag       string
	EtagTest   bool
}

func (MethodUpdate) Generate

func (m MethodUpdate) Generate(f *protogen.GeneratedFile, response, err, assign string)

Jump to

Keyboard shortcuts

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