Documentation ¶
Index ¶
- Constants
- Variables
- func HydrateDynamicOptions(schemas TypeURLToSchemasMap, options map[string][]*resolverv1.Option)
- func MarshalProtoSlice(pbs interface{}) ([]*anypb.Any, error)
- func MessageSlice(s interface{}) []proto.Message
- func TypeURL(m protodeprecated.Message) stringdeprecated
- type Factory
- type FanoutHandler
- type FanoutResult
- type Resolver
- type Results
- type TypeURLToSchemaMessagesMap
- type TypeURLToSchemasMap
Constants ¶
View Source
const ( OptionAll = "__ALL__" // TODO: Layout the ground work for resolver configurations // allowing a user to set the default autocomplete limit DefaultAutocompleteLimit = 50 )
View Source
const TypePrefix = "type.googleapis.com/"
Variables ¶
View Source
var Registry = map[string]Resolver{}
Functions ¶
func HydrateDynamicOptions ¶
func HydrateDynamicOptions(schemas TypeURLToSchemasMap, options map[string][]*resolverv1.Option)
func MarshalProtoSlice ¶
func MessageSlice ¶
MessageSlice takes a slice of protobuf objects and converts them to a slice of generic protobuf Messages.
func TypeURL
deprecated
func TypeURL(m protodeprecated.Message) string
Deprecated: use meta.TypeURL instead, will require moving to new proto APIs.
Types ¶
type FanoutHandler ¶
type FanoutHandler interface { Add(delta int) Done() Cancelled() <-chan struct{} Channel() chan<- FanoutResult Results(limit uint32) (*Results, error) }
func NewFanoutHandler ¶
func NewFanoutHandler(ctx context.Context) (context.Context, FanoutHandler)
type FanoutResult ¶
func NewFanoutResult ¶
func NewFanoutResult(pbSlice interface{}, err error) FanoutResult
func NewSingleFanoutResult ¶
func NewSingleFanoutResult(message proto.Message, err error) FanoutResult
type Resolver ¶
type Resolver interface { Schemas() TypeURLToSchemasMap Search(ctx context.Context, typeURL, query string, limit uint32) (*Results, error) Resolve(ctx context.Context, typeURL string, input protodeprecated.Message, limit uint32) (*Results, error) Autocomplete(ctx context.Context, typeURL, search string, limit uint64, caseSensitive bool) ([]*resolverv1.AutocompleteResult, error) }
type TypeURLToSchemaMessagesMap ¶
Input map from resolvers with the type URL of the resolved object mapped to the schema's message. e.g. {"v1.Instance": [v1.Name, v1.IPAddress]}
type TypeURLToSchemasMap ¶
type TypeURLToSchemasMap map[string][]*resolverv1.Schema
Output map used by the resolver after the input TypeURLToSchemaMessagesMap was used to read metadata from the protobuf objects. e.g. {"v1.Instance": [{"DisplayName": "Name", "Searchable": true}, {"DisplayName": "IP Address", "Searchable": true}]}
func InputsToSchemas ¶
func InputsToSchemas(typeSchemas TypeURLToSchemaMessagesMap) (TypeURLToSchemasMap, error)
Pass in annotated resolver input objects and return schemas for them.
Click to show internal directories.
Click to hide internal directories.