Documentation
¶
Index ¶
- Constants
- Variables
- func ChainUnaryInterceptors(interceptors []grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor
- func EnumValuesAsString(e map[string]int32) string
- func HTTPStatusFromCode(code codes.Code) int
- func MetadataForRequest(req *http.Request, methodFulLName string) metadata.MD
- func NewMethodDescContext(ctx context.Context, methodDesc *MethodDesc) context.Context
- func PeerForRequest(req *http.Request) *peer.Peer
- func TimeoutForRequest(req *http.Request) (time.Duration, bool)
- type DecoderInput
- type FieldOption
- func (*FieldOption) Descriptor() ([]byte, []int)deprecated
- func (x *FieldOption) GetReadOnlySpec() bool
- func (x *FieldOption) GetRequiredSpec() bool
- func (*FieldOption) ProtoMessage()
- func (x *FieldOption) ProtoReflect() protoreflect.Message
- func (x *FieldOption) Reset()
- func (x *FieldOption) String() string
- type FieldOptions
- type MessageOption
- func (*MessageOption) Descriptor() ([]byte, []int)deprecated
- func (x *MessageOption) GetForceExpose() bool
- func (x *MessageOption) GetTerraformEntity() *TerraformEntity
- func (x *MessageOption) GetTitle() string
- func (x *MessageOption) GetWebhookRequestName() string
- func (*MessageOption) ProtoMessage()
- func (x *MessageOption) ProtoReflect() protoreflect.Message
- func (x *MessageOption) Reset()
- func (x *MessageOption) String() string
- type MessageOptions
- type MethodDesc
- type MethodOptions
- type Operation
- func (*Operation) Descriptor() ([]byte, []int)deprecated
- func (x *Operation) GetDocsPath() string
- func (x *Operation) GetGroup() string
- func (x *Operation) GetMethod() string
- func (x *Operation) GetQuery() map[string]string
- func (x *Operation) GetRequestExamples() []*RequestExample
- func (x *Operation) GetResponseExamples() []*ResponseExample
- func (x *Operation) GetRoute() string
- func (x *Operation) GetStability() Stability
- func (x *Operation) GetSummary() string
- func (x *Operation) GetTerraformEntity() *TerraformEntity
- func (*Operation) ProtoMessage()
- func (x *Operation) ProtoReflect() protoreflect.Message
- func (x *Operation) Reset()
- func (x *Operation) String() string
- type RequestExample
- func (*RequestExample) Descriptor() ([]byte, []int)deprecated
- func (x *RequestExample) GetName() string
- func (x *RequestExample) GetPath() string
- func (*RequestExample) ProtoMessage()
- func (x *RequestExample) ProtoReflect() protoreflect.Message
- func (x *RequestExample) Reset()
- func (x *RequestExample) String() string
- type ResponseExample
- func (*ResponseExample) Descriptor() ([]byte, []int)deprecated
- func (x *ResponseExample) GetName() string
- func (x *ResponseExample) GetPath() string
- func (*ResponseExample) ProtoMessage()
- func (x *ResponseExample) ProtoReflect() protoreflect.Message
- func (x *ResponseExample) Reset()
- func (x *ResponseExample) String() string
- type RouteToken
- type Server
- type Service
- func (*Service) Descriptor() ([]byte, []int)deprecated
- func (x *Service) GetDocsPath() string
- func (x *Service) GetServers() []*Server
- func (x *Service) GetStability() Stability
- func (*Service) ProtoMessage()
- func (x *Service) ProtoReflect() protoreflect.Message
- func (x *Service) Reset()
- func (x *Service) String() string
- type ServiceDesc
- type ServiceOptions
- type ServiceRegistrar
- type Stability
- type TerraformEntity
- func (*TerraformEntity) Descriptor() ([]byte, []int)deprecated
- func (x *TerraformEntity) GetJson() bool
- func (x *TerraformEntity) GetName() string
- func (x *TerraformEntity) GetType() TerraformEntity_TerraformEntityMethodType
- func (*TerraformEntity) ProtoMessage()
- func (x *TerraformEntity) ProtoReflect() protoreflect.Message
- func (x *TerraformEntity) Reset()
- func (x *TerraformEntity) String() string
- type TerraformEntity_TerraformEntityMethodType
- func (TerraformEntity_TerraformEntityMethodType) Descriptor() protoreflect.EnumDescriptor
- func (x TerraformEntity_TerraformEntityMethodType) Enum() *TerraformEntity_TerraformEntityMethodType
- func (TerraformEntity_TerraformEntityMethodType) EnumDescriptor() ([]byte, []int)deprecated
- func (x TerraformEntity_TerraformEntityMethodType) Number() protoreflect.EnumNumber
- func (x TerraformEntity_TerraformEntityMethodType) String() string
- func (TerraformEntity_TerraformEntityMethodType) Type() protoreflect.EnumType
Constants ¶
const ( MetadataOriginalPath = ":apigw-original-path" MetadataOriginalMethod = ":apigw-original-method" )
Variables ¶
var ( Stability_name = map[int32]string{ 0: "STABILITY_UNSPECIFIED", 1: "STABILITY_STABLE", 2: "STABILITY_EXPERIMENTAL", 3: "STABILITY_DEPRECATED", } Stability_value = map[string]int32{ "STABILITY_UNSPECIFIED": 0, "STABILITY_STABLE": 1, "STABILITY_EXPERIMENTAL": 2, "STABILITY_DEPRECATED": 3, } )
Enum value maps for Stability.
var ( TerraformEntity_TerraformEntityMethodType_name = map[int32]string{ 0: "TERRAFORM_ENTITY_METHOD_TYPE_UNSPECIFIED", 1: "TERRAFORM_ENTITY_METHOD_TYPE_CREATE", 2: "TERRAFORM_ENTITY_METHOD_TYPE_READ", 3: "TERRAFORM_ENTITY_METHOD_TYPE_UPDATE", 4: "TERRAFORM_ENTITY_METHOD_TYPE_DELETE", } TerraformEntity_TerraformEntityMethodType_value = map[string]int32{ "TERRAFORM_ENTITY_METHOD_TYPE_UNSPECIFIED": 0, "TERRAFORM_ENTITY_METHOD_TYPE_CREATE": 1, "TERRAFORM_ENTITY_METHOD_TYPE_READ": 2, "TERRAFORM_ENTITY_METHOD_TYPE_UPDATE": 3, "TERRAFORM_ENTITY_METHOD_TYPE_DELETE": 4, } )
Enum value maps for TerraformEntity_TerraformEntityMethodType.
var (
// optional apigw.v1.FieldOptions field = 7652;
E_Field = &file_apigw_v1_apigw_proto_extTypes[2]
)
Extension fields to descriptorpb.FieldOptions.
var (
// optional apigw.v1.MessageOptions message = 7653;
E_Message = &file_apigw_v1_apigw_proto_extTypes[3]
)
Extension fields to descriptorpb.MessageOptions.
var (
// optional apigw.v1.MethodOptions method = 7651;
E_Method = &file_apigw_v1_apigw_proto_extTypes[1]
)
Extension fields to descriptorpb.MethodOptions.
var (
// optional apigw.v1.ServiceOptions service = 7650;
E_Service = &file_apigw_v1_apigw_proto_extTypes[0]
)
Extension fields to descriptorpb.ServiceOptions.
var File_apigw_v1_apigw_proto protoreflect.FileDescriptor
Functions ¶
func ChainUnaryInterceptors ¶
func ChainUnaryInterceptors(interceptors []grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor
based on https://github.com/grpc/grpc-go/blob/v1.55.0/server.go
ChainUnaryInterceptors chains multiple unary interceptors into a single interceptor.
func EnumValuesAsString ¶
func HTTPStatusFromCode ¶
based on https://github.com/grpc-ecosystem/grpc-gateway/blob/main/runtime/errors.go
HTTPStatusFromCode converts a gRPC error code into the corresponding HTTP response status. See: https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto
func MetadataForRequest ¶
func NewMethodDescContext ¶
func NewMethodDescContext(ctx context.Context, methodDesc *MethodDesc) context.Context
Types ¶
type DecoderInput ¶
type FieldOption ¶
type FieldOption struct { // Sets the field as required in the generated openAPI spec. RequiredSpec bool `protobuf:"varint,1,opt,name=required_spec,json=requiredSpec,proto3" json:"required_spec,omitempty"` // Sets the field as read only in the generated openAPI spec. ReadOnlySpec bool `protobuf:"varint,2,opt,name=read_only_spec,json=readOnlySpec,proto3" json:"read_only_spec,omitempty"` // contains filtered or unexported fields }
func (*FieldOption) Descriptor
deprecated
func (*FieldOption) Descriptor() ([]byte, []int)
Deprecated: Use FieldOption.ProtoReflect.Descriptor instead.
func (*FieldOption) GetReadOnlySpec ¶
func (x *FieldOption) GetReadOnlySpec() bool
func (*FieldOption) GetRequiredSpec ¶
func (x *FieldOption) GetRequiredSpec() bool
func (*FieldOption) ProtoMessage ¶
func (*FieldOption) ProtoMessage()
func (*FieldOption) ProtoReflect ¶
func (x *FieldOption) ProtoReflect() protoreflect.Message
func (*FieldOption) Reset ¶
func (x *FieldOption) Reset()
func (*FieldOption) String ¶
func (x *FieldOption) String() string
type FieldOptions ¶
type FieldOptions struct { FieldOptions []*FieldOption `protobuf:"bytes,1,rep,name=field_options,json=fieldOptions,proto3" json:"field_options,omitempty"` // contains filtered or unexported fields }
func (*FieldOptions) Descriptor
deprecated
func (*FieldOptions) Descriptor() ([]byte, []int)
Deprecated: Use FieldOptions.ProtoReflect.Descriptor instead.
func (*FieldOptions) GetFieldOptions ¶
func (x *FieldOptions) GetFieldOptions() []*FieldOption
func (*FieldOptions) ProtoMessage ¶
func (*FieldOptions) ProtoMessage()
func (*FieldOptions) ProtoReflect ¶
func (x *FieldOptions) ProtoReflect() protoreflect.Message
func (*FieldOptions) Reset ¶
func (x *FieldOptions) Reset()
func (*FieldOptions) String ¶
func (x *FieldOptions) String() string
type MessageOption ¶
type MessageOption struct { TerraformEntity *TerraformEntity `protobuf:"bytes,1,opt,name=terraform_entity,json=terraformEntity,proto3" json:"terraform_entity,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` // Messages are only exposed if they are in (or descend from) an RPC service. // This option overrides that by forcing generation of this (and referenced) message. ForceExpose bool `protobuf:"varint,3,opt,name=force_expose,json=forceExpose,proto3" json:"force_expose,omitempty"` // Set this to process this message as the body of a webhook WebhookRequestName string `protobuf:"bytes,4,opt,name=webhook_request_name,json=webhookRequestName,proto3" json:"webhook_request_name,omitempty"` // contains filtered or unexported fields }
func (*MessageOption) Descriptor
deprecated
func (*MessageOption) Descriptor() ([]byte, []int)
Deprecated: Use MessageOption.ProtoReflect.Descriptor instead.
func (*MessageOption) GetForceExpose ¶
func (x *MessageOption) GetForceExpose() bool
func (*MessageOption) GetTerraformEntity ¶
func (x *MessageOption) GetTerraformEntity() *TerraformEntity
func (*MessageOption) GetTitle ¶
func (x *MessageOption) GetTitle() string
func (*MessageOption) GetWebhookRequestName ¶
func (x *MessageOption) GetWebhookRequestName() string
func (*MessageOption) ProtoMessage ¶
func (*MessageOption) ProtoMessage()
func (*MessageOption) ProtoReflect ¶
func (x *MessageOption) ProtoReflect() protoreflect.Message
func (*MessageOption) Reset ¶
func (x *MessageOption) Reset()
func (*MessageOption) String ¶
func (x *MessageOption) String() string
type MessageOptions ¶
type MessageOptions struct { MessageOptions []*MessageOption `protobuf:"bytes,1,rep,name=message_options,json=messageOptions,proto3" json:"message_options,omitempty"` // contains filtered or unexported fields }
func (*MessageOptions) Descriptor
deprecated
func (*MessageOptions) Descriptor() ([]byte, []int)
Deprecated: Use MessageOptions.ProtoReflect.Descriptor instead.
func (*MessageOptions) GetMessageOptions ¶
func (x *MessageOptions) GetMessageOptions() []*MessageOption
func (*MessageOptions) ProtoMessage ¶
func (*MessageOptions) ProtoMessage()
func (*MessageOptions) ProtoReflect ¶
func (x *MessageOptions) ProtoReflect() protoreflect.Message
func (*MessageOptions) Reset ¶
func (x *MessageOptions) Reset()
func (*MessageOptions) String ¶
func (x *MessageOptions) String() string
type MethodDesc ¶
type MethodDesc struct { Name string Method string Route string Handler methodHandler Decoder decoderHandler Spec *Operation }
func MethodDescContext ¶
func MethodDescContext(ctx context.Context) *MethodDesc
type MethodOptions ¶
type MethodOptions struct { Operations []*Operation `protobuf:"bytes,1,rep,name=operations,proto3" json:"operations,omitempty"` // contains filtered or unexported fields }
func (*MethodOptions) Descriptor
deprecated
func (*MethodOptions) Descriptor() ([]byte, []int)
Deprecated: Use MethodOptions.ProtoReflect.Descriptor instead.
func (*MethodOptions) GetOperations ¶
func (x *MethodOptions) GetOperations() []*Operation
func (*MethodOptions) ProtoMessage ¶
func (*MethodOptions) ProtoMessage()
func (*MethodOptions) ProtoReflect ¶
func (x *MethodOptions) ProtoReflect() protoreflect.Message
func (*MethodOptions) Reset ¶
func (x *MethodOptions) Reset()
func (*MethodOptions) String ¶
func (x *MethodOptions) String() string
type Operation ¶
type Operation struct { Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` Route string `protobuf:"bytes,2,opt,name=route,proto3" json:"route,omitempty"` Query map[string]string `` /* 137-byte string literal not displayed */ Stability Stability `protobuf:"varint,4,opt,name=stability,proto3,enum=apigw.v1.Stability" json:"stability,omitempty"` DocsPath string `protobuf:"bytes,5,opt,name=docs_path,json=docsPath,proto3" json:"docs_path,omitempty"` RequestExamples []*RequestExample `protobuf:"bytes,6,rep,name=request_examples,json=requestExamples,proto3" json:"request_examples,omitempty"` ResponseExamples []*ResponseExample `protobuf:"bytes,7,rep,name=response_examples,json=responseExamples,proto3" json:"response_examples,omitempty"` TerraformEntity *TerraformEntity `protobuf:"bytes,8,opt,name=terraform_entity,json=terraformEntity,proto3" json:"terraform_entity,omitempty"` Summary string `protobuf:"bytes,9,opt,name=summary,proto3" json:"summary,omitempty"` Group string `protobuf:"bytes,10,opt,name=group,proto3" json:"group,omitempty"` // contains filtered or unexported fields }
func (*Operation) Descriptor
deprecated
func (*Operation) GetDocsPath ¶
func (*Operation) GetRequestExamples ¶
func (x *Operation) GetRequestExamples() []*RequestExample
func (*Operation) GetResponseExamples ¶
func (x *Operation) GetResponseExamples() []*ResponseExample
func (*Operation) GetStability ¶
func (*Operation) GetSummary ¶
func (*Operation) GetTerraformEntity ¶
func (x *Operation) GetTerraformEntity() *TerraformEntity
func (*Operation) ProtoMessage ¶
func (*Operation) ProtoMessage()
func (*Operation) ProtoReflect ¶
func (x *Operation) ProtoReflect() protoreflect.Message
type RequestExample ¶
type RequestExample struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` // contains filtered or unexported fields }
func (*RequestExample) Descriptor
deprecated
func (*RequestExample) Descriptor() ([]byte, []int)
Deprecated: Use RequestExample.ProtoReflect.Descriptor instead.
func (*RequestExample) GetName ¶
func (x *RequestExample) GetName() string
func (*RequestExample) GetPath ¶
func (x *RequestExample) GetPath() string
func (*RequestExample) ProtoMessage ¶
func (*RequestExample) ProtoMessage()
func (*RequestExample) ProtoReflect ¶
func (x *RequestExample) ProtoReflect() protoreflect.Message
func (*RequestExample) Reset ¶
func (x *RequestExample) Reset()
func (*RequestExample) String ¶
func (x *RequestExample) String() string
type ResponseExample ¶
type ResponseExample struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` // contains filtered or unexported fields }
func (*ResponseExample) Descriptor
deprecated
func (*ResponseExample) Descriptor() ([]byte, []int)
Deprecated: Use ResponseExample.ProtoReflect.Descriptor instead.
func (*ResponseExample) GetName ¶
func (x *ResponseExample) GetName() string
func (*ResponseExample) GetPath ¶
func (x *ResponseExample) GetPath() string
func (*ResponseExample) ProtoMessage ¶
func (*ResponseExample) ProtoMessage()
func (*ResponseExample) ProtoReflect ¶
func (x *ResponseExample) ProtoReflect() protoreflect.Message
func (*ResponseExample) Reset ¶
func (x *ResponseExample) Reset()
func (*ResponseExample) String ¶
func (x *ResponseExample) String() string
type RouteToken ¶
func ParseRoute ¶
func ParseRoute(path string) ([]RouteToken, error)
Parses a HTP Route path into a list of RouteTokens. For example a route can be:
/v1/thng/{app_id} /v1/users/{user_id}/devices/{device_id}
This is NOT a fully compliant port of the gRPC HTTP API spec, but its "good enough" for now.
type Server ¶
type Server struct { Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` // contains filtered or unexported fields }
func (*Server) Descriptor
deprecated
func (*Server) GetDescription ¶
func (*Server) ProtoMessage ¶
func (*Server) ProtoMessage()
func (*Server) ProtoReflect ¶
func (x *Server) ProtoReflect() protoreflect.Message
type Service ¶
type Service struct { Stability Stability `protobuf:"varint,1,opt,name=stability,proto3,enum=apigw.v1.Stability" json:"stability,omitempty"` DocsPath string `protobuf:"bytes,2,opt,name=docs_path,json=docsPath,proto3" json:"docs_path,omitempty"` Servers []*Server `protobuf:"bytes,3,rep,name=servers,proto3" json:"servers,omitempty"` // contains filtered or unexported fields }
func (*Service) Descriptor
deprecated
func (*Service) GetDocsPath ¶
func (*Service) GetServers ¶
func (*Service) GetStability ¶
func (*Service) ProtoMessage ¶
func (*Service) ProtoMessage()
func (*Service) ProtoReflect ¶
func (x *Service) ProtoReflect() protoreflect.Message
type ServiceDesc ¶
type ServiceDesc struct { Name string // The pointer to the service interface. Used to check whether the user // provided implementation satisfies the interface requirements. HandlerType interface{} Methods []*MethodDesc Spec *Service }
type ServiceOptions ¶
type ServiceOptions struct { Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` // contains filtered or unexported fields }
func (*ServiceOptions) Descriptor
deprecated
func (*ServiceOptions) Descriptor() ([]byte, []int)
Deprecated: Use ServiceOptions.ProtoReflect.Descriptor instead.
func (*ServiceOptions) GetService ¶
func (x *ServiceOptions) GetService() *Service
func (*ServiceOptions) ProtoMessage ¶
func (*ServiceOptions) ProtoMessage()
func (*ServiceOptions) ProtoReflect ¶
func (x *ServiceOptions) ProtoReflect() protoreflect.Message
func (*ServiceOptions) Reset ¶
func (x *ServiceOptions) Reset()
func (*ServiceOptions) String ¶
func (x *ServiceOptions) String() string
type ServiceRegistrar ¶
type ServiceRegistrar interface {
RegisterService(sd *ServiceDesc, ss interface{})
}
type Stability ¶
type Stability int32
func (Stability) Descriptor ¶
func (Stability) Descriptor() protoreflect.EnumDescriptor
func (Stability) EnumDescriptor
deprecated
func (Stability) Number ¶
func (x Stability) Number() protoreflect.EnumNumber
func (Stability) Type ¶
func (Stability) Type() protoreflect.EnumType
type TerraformEntity ¶
type TerraformEntity struct { Type TerraformEntity_TerraformEntityMethodType `protobuf:"varint,1,opt,name=type,proto3,enum=apigw.v1.TerraformEntity_TerraformEntityMethodType" json:"type,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Json bool `protobuf:"varint,3,opt,name=json,proto3" json:"json,omitempty"` // contains filtered or unexported fields }
func (*TerraformEntity) Descriptor
deprecated
func (*TerraformEntity) Descriptor() ([]byte, []int)
Deprecated: Use TerraformEntity.ProtoReflect.Descriptor instead.
func (*TerraformEntity) GetJson ¶
func (x *TerraformEntity) GetJson() bool
func (*TerraformEntity) GetName ¶
func (x *TerraformEntity) GetName() string
func (*TerraformEntity) GetType ¶
func (x *TerraformEntity) GetType() TerraformEntity_TerraformEntityMethodType
func (*TerraformEntity) ProtoMessage ¶
func (*TerraformEntity) ProtoMessage()
func (*TerraformEntity) ProtoReflect ¶
func (x *TerraformEntity) ProtoReflect() protoreflect.Message
func (*TerraformEntity) Reset ¶
func (x *TerraformEntity) Reset()
func (*TerraformEntity) String ¶
func (x *TerraformEntity) String() string
type TerraformEntity_TerraformEntityMethodType ¶
type TerraformEntity_TerraformEntityMethodType int32
const ( TerraformEntity_TERRAFORM_ENTITY_METHOD_TYPE_UNSPECIFIED TerraformEntity_TerraformEntityMethodType = 0 TerraformEntity_TERRAFORM_ENTITY_METHOD_TYPE_CREATE TerraformEntity_TerraformEntityMethodType = 1 TerraformEntity_TERRAFORM_ENTITY_METHOD_TYPE_READ TerraformEntity_TerraformEntityMethodType = 2 TerraformEntity_TERRAFORM_ENTITY_METHOD_TYPE_UPDATE TerraformEntity_TerraformEntityMethodType = 3 TerraformEntity_TERRAFORM_ENTITY_METHOD_TYPE_DELETE TerraformEntity_TerraformEntityMethodType = 4 )
func (TerraformEntity_TerraformEntityMethodType) Descriptor ¶
func (TerraformEntity_TerraformEntityMethodType) Descriptor() protoreflect.EnumDescriptor
func (TerraformEntity_TerraformEntityMethodType) EnumDescriptor
deprecated
func (TerraformEntity_TerraformEntityMethodType) EnumDescriptor() ([]byte, []int)
Deprecated: Use TerraformEntity_TerraformEntityMethodType.Descriptor instead.
func (TerraformEntity_TerraformEntityMethodType) Number ¶
func (x TerraformEntity_TerraformEntityMethodType) Number() protoreflect.EnumNumber
func (TerraformEntity_TerraformEntityMethodType) String ¶
func (x TerraformEntity_TerraformEntityMethodType) String() string
func (TerraformEntity_TerraformEntityMethodType) Type ¶
func (TerraformEntity_TerraformEntityMethodType) Type() protoreflect.EnumType