Documentation ¶
Index ¶
- func APIBody(body interface{}) (*anypb.Any, error)
- func ClearLogDisabledFields(m proto.Message) proto.Message
- func ExtractPatternValuesFromString(pb proto.Message, value string) (map[string]string, bool, error)
- func GenerateGRPCMetadata(server *grpc.Server) error
- func GetAction(method string) apiv1.ActionType
- func HydratedPatternForProto(pb proto.Message) (string, error)
- func IsAuditDisabled(method string) bool
- func IsRedacted(pb proto.Message) bool
- func ResourceNames(pb proto.Message) []*auditv1.Resource
- func ToValue(data interface{}) (*structpb.Value, error)
- func TypeURL(pb proto.Message) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIBody ¶
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 ¶
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 GetAction ¶
func GetAction(method string) apiv1.ActionType
func HydratedPatternForProto ¶
HydratedPatternForProto takes a proto and returns its pattern populated with values
func IsAuditDisabled ¶
func IsRedacted ¶
func ToValue ¶
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
Types ¶
This section is empty.