meta

package
v0.0.0-...-e01fbee Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIBody

func APIBody(body interface{}) (*anypb.Any, error)

APIBody returns a API request/response interface as an anypb.Any message, with any redaction or clearing based on message or field annotations.

func ClearLogDisabledFields

func ClearLogDisabledFields(m proto.Message) proto.Message

If fields have the option log set to false,

func ExtractPatternValuesFromString

func ExtractPatternValuesFromString(pb proto.Message, value string) (map[string]string, bool, error)

ExtractPatternValuesFromString takes a string value and maps the patterns from a proto pattern this is utilized by the resolver search api

For example given the following proto pattern:

option (clutch.api.v1.id).patterns = {
	pattern : "{cluster}/{namespace}/{name}"
};

And the value of "mycluster/mynamespace/nameofresource" we transform the pattern into a regex and map the values to the pattern names

The output for this example is:

map[string]string{
 cluster: mycluster
 namespace: mynamespace
 name: nameofresource
}

func GenerateGRPCMetadata

func GenerateGRPCMetadata(server *grpc.Server) error

func GetAction

func GetAction(method string) apiv1.ActionType

func HydratedPatternForProto

func HydratedPatternForProto(pb proto.Message) (string, error)

HydratedPatternForProto takes a proto and returns its pattern populated with values

func IsAuditDisabled

func IsAuditDisabled(method string) bool

func IsRedacted

func IsRedacted(pb proto.Message) bool

func ResourceNames

func ResourceNames(pb proto.Message) []*auditv1.Resource

func ToValue

func ToValue(data interface{}) (*structpb.Value, error)

ToValue converts custom types to a structpb.Value. This helper was added since structpb.NewValue has a limited set of types that it supports. More details here: https://github.com/golang/protobuf/issues/1302#issuecomment-805453221

func TypeURL

func TypeURL(pb proto.Message) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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