v1

package
v0.0.0-...-5119b85 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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.

View Source
var (
	// optional apigw.v1.FieldOptions field = 7652;
	E_Field = &file_apigw_v1_apigw_proto_extTypes[2]
)

Extension fields to descriptorpb.FieldOptions.

View Source
var (
	// optional apigw.v1.MessageOptions message = 7653;
	E_Message = &file_apigw_v1_apigw_proto_extTypes[3]
)

Extension fields to descriptorpb.MessageOptions.

View Source
var (
	// optional apigw.v1.MethodOptions method = 7651;
	E_Method = &file_apigw_v1_apigw_proto_extTypes[1]
)

Extension fields to descriptorpb.MethodOptions.

View Source
var (
	// optional apigw.v1.ServiceOptions service = 7650;
	E_Service = &file_apigw_v1_apigw_proto_extTypes[0]
)

Extension fields to descriptorpb.ServiceOptions.

View Source
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 EnumValuesAsString(e map[string]int32) string

func HTTPStatusFromCode

func HTTPStatusFromCode(code codes.Code) int

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 MetadataForRequest(req *http.Request, methodFulLName string) metadata.MD

func PeerForRequest

func PeerForRequest(req *http.Request) *peer.Peer

func TimeoutForRequest

func TimeoutForRequest(req *http.Request) (time.Duration, bool)

Types

type DecoderInput

type DecoderInput interface {
	Body() io.Reader
	Query() url.Values
	PathParam(name string) string
}

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"`
	// contains filtered or unexported fields
}

func (*MessageOption) Descriptor deprecated

func (*MessageOption) Descriptor() ([]byte, []int)

Deprecated: Use MessageOption.ProtoReflect.Descriptor instead.

func (*MessageOption) GetTerraformEntity

func (x *MessageOption) GetTerraformEntity() *TerraformEntity

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
}

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  `` /* 151-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"`
	// contains filtered or unexported fields
}

func (*Operation) Descriptor deprecated

func (*Operation) Descriptor() ([]byte, []int)

Deprecated: Use Operation.ProtoReflect.Descriptor instead.

func (*Operation) GetDocsPath

func (x *Operation) GetDocsPath() string

func (*Operation) GetMethod

func (x *Operation) GetMethod() string

func (*Operation) GetQuery

func (x *Operation) GetQuery() map[string]string

func (*Operation) GetRequestExamples

func (x *Operation) GetRequestExamples() []*RequestExample

func (*Operation) GetResponseExamples

func (x *Operation) GetResponseExamples() []*ResponseExample

func (*Operation) GetRoute

func (x *Operation) GetRoute() string

func (*Operation) GetStability

func (x *Operation) GetStability() Stability

func (*Operation) GetTerraformEntity

func (x *Operation) GetTerraformEntity() *TerraformEntity

func (*Operation) ProtoMessage

func (*Operation) ProtoMessage()

func (*Operation) ProtoReflect

func (x *Operation) ProtoReflect() protoreflect.Message

func (*Operation) Reset

func (x *Operation) Reset()

func (*Operation) String

func (x *Operation) String() string

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

type RouteToken struct {
	IsParam    bool
	ParamName  string
	ParamIndex int
	Value      string
}

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 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"`
	// contains filtered or unexported fields
}

func (*Service) Descriptor deprecated

func (*Service) Descriptor() ([]byte, []int)

Deprecated: Use Service.ProtoReflect.Descriptor instead.

func (*Service) GetDocsPath

func (x *Service) GetDocsPath() string

func (*Service) GetStability

func (x *Service) GetStability() Stability

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) ProtoReflect

func (x *Service) ProtoReflect() protoreflect.Message

func (*Service) Reset

func (x *Service) Reset()

func (*Service) String

func (x *Service) String() string

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
const (
	Stability_STABILITY_UNSPECIFIED  Stability = 0
	Stability_STABILITY_STABLE       Stability = 1
	Stability_STABILITY_EXPERIMENTAL Stability = 2
	Stability_STABILITY_DEPRECATED   Stability = 3
)

func (Stability) Descriptor

func (Stability) Descriptor() protoreflect.EnumDescriptor

func (Stability) Enum

func (x Stability) Enum() *Stability

func (Stability) EnumDescriptor deprecated

func (Stability) EnumDescriptor() ([]byte, []int)

Deprecated: Use Stability.Descriptor instead.

func (Stability) Number

func (x Stability) Number() protoreflect.EnumNumber

func (Stability) String

func (x Stability) String() string

func (Stability) Type

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"`
	// contains filtered or unexported fields
}

func (*TerraformEntity) Descriptor deprecated

func (*TerraformEntity) Descriptor() ([]byte, []int)

Deprecated: Use TerraformEntity.ProtoReflect.Descriptor instead.

func (*TerraformEntity) GetName

func (x *TerraformEntity) GetName() string

func (*TerraformEntity) GetType

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) Enum

func (TerraformEntity_TerraformEntityMethodType) EnumDescriptor deprecated

func (TerraformEntity_TerraformEntityMethodType) EnumDescriptor() ([]byte, []int)

Deprecated: Use TerraformEntity_TerraformEntityMethodType.Descriptor instead.

func (TerraformEntity_TerraformEntityMethodType) Number

func (TerraformEntity_TerraformEntityMethodType) String

func (TerraformEntity_TerraformEntityMethodType) Type

Jump to

Keyboard shortcuts

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