route

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package route is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Route_Type_name = map[int32]string{
		0: "FORWARD",
		1: "REDIRECT",
		2: "DIRECT_RESPONSE",
	}
	Route_Type_value = map[string]int32{
		"FORWARD":         0,
		"REDIRECT":        1,
		"DIRECT_RESPONSE": 2,
	}
)

Enum value maps for Route_Type.

View Source
var File_route_route_proto protoreflect.FileDescriptor
View Source
var RouteService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "route.RouteService",
	HandlerType: (*RouteServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _RouteService_List_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _RouteService_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _RouteService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _RouteService_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "route/route.proto",
}

RouteService_ServiceDesc is the grpc.ServiceDesc for RouteService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterRouteServiceHandler

func RegisterRouteServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterRouteServiceHandler registers the http handlers for service RouteService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterRouteServiceHandlerClient

func RegisterRouteServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RouteServiceClient) error

RegisterRouteServiceHandlerClient registers the http handlers for service RouteService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RouteServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RouteServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "RouteServiceClient" to call the correct interceptors.

func RegisterRouteServiceHandlerFromEndpoint

func RegisterRouteServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterRouteServiceHandlerFromEndpoint is same as RegisterRouteServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterRouteServiceHandlerServer

func RegisterRouteServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RouteServiceServer) error

RegisterRouteServiceHandlerServer registers the http handlers for service RouteService to "mux". UnaryRPC :call RouteServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRouteServiceHandlerFromEndpoint instead.

func RegisterRouteServiceServer

func RegisterRouteServiceServer(s grpc.ServiceRegistrar, srv RouteServiceServer)

Types

type Cors

type Cors struct {
	Enabled          bool     `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	AllowOrigins     []string `protobuf:"bytes,2,rep,name=allow_origins,json=allowOrigins,proto3" json:"allowOrigins,omitempty"`              // @gotags: json:"allowOrigins,omitempty"
	AllowMethods     []string `protobuf:"bytes,3,rep,name=allow_methods,json=allowMethods,proto3" json:"allowMethods,omitempty"`              // @gotags: json:"allowMethods,omitempty"
	AllowHeaders     []string `protobuf:"bytes,4,rep,name=allow_headers,json=allowHeaders,proto3" json:"allowHeaders,omitempty"`              // @gotags: json:"allowHeaders,omitempty"
	ExposeHeaders    []string `protobuf:"bytes,5,rep,name=expose_headers,json=exposeHeaders,proto3" json:"exposeHeaders,omitempty"`           // @gotags: json:"exposeHeaders,omitempty"
	AllowCredentials bool     `protobuf:"varint,6,opt,name=allow_credentials,json=allowCredentials,proto3" json:"allowCredentials,omitempty"` // @gotags: json:"allowCredentials,omitempty"
	MaxAge           uint32   `protobuf:"varint,7,opt,name=max_age,json=maxAge,proto3" json:"maxAge,omitempty"`                               // @gotags: json:"maxAge,omitempty"
	// contains filtered or unexported fields
}

func (*Cors) Descriptor deprecated

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

Deprecated: Use Cors.ProtoReflect.Descriptor instead.

func (*Cors) GetAllowCredentials

func (x *Cors) GetAllowCredentials() bool

func (*Cors) GetAllowHeaders

func (x *Cors) GetAllowHeaders() []string

func (*Cors) GetAllowMethods

func (x *Cors) GetAllowMethods() []string

func (*Cors) GetAllowOrigins

func (x *Cors) GetAllowOrigins() []string

func (*Cors) GetEnabled

func (x *Cors) GetEnabled() bool

func (*Cors) GetExposeHeaders

func (x *Cors) GetExposeHeaders() []string

func (*Cors) GetMaxAge

func (x *Cors) GetMaxAge() uint32

func (*Cors) ProtoMessage

func (*Cors) ProtoMessage()

func (*Cors) ProtoReflect

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

func (*Cors) Reset

func (x *Cors) Reset()

func (*Cors) String

func (x *Cors) String() string

func (*Cors) Validate

func (m *Cors) Validate() error

Validate checks the field values on Cors with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Cors) ValidateAll

func (m *Cors) ValidateAll() error

ValidateAll checks the field values on Cors with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CorsMultiError, or nil if none found.

type CorsMultiError

type CorsMultiError []error

CorsMultiError is an error wrapping multiple validation errors returned by Cors.ValidateAll() if the designated constraints aren't met.

func (CorsMultiError) AllErrors

func (m CorsMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CorsMultiError) Error

func (m CorsMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type CorsValidationError

type CorsValidationError struct {
	// contains filtered or unexported fields
}

CorsValidationError is the validation error returned by Cors.Validate if the designated constraints aren't met.

func (CorsValidationError) Cause

func (e CorsValidationError) Cause() error

Cause function returns cause value.

func (CorsValidationError) Error

func (e CorsValidationError) Error() string

Error satisfies the builtin error interface

func (CorsValidationError) ErrorName

func (e CorsValidationError) ErrorName() string

ErrorName returns error name.

func (CorsValidationError) Field

func (e CorsValidationError) Field() string

Field function returns field value.

func (CorsValidationError) Key

func (e CorsValidationError) Key() bool

Key function returns key value.

func (CorsValidationError) Reason

func (e CorsValidationError) Reason() string

Reason function returns reason value.

type DirectResponse

type DirectResponse struct {
	Code uint32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"`
	Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

func (*DirectResponse) Descriptor deprecated

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

Deprecated: Use DirectResponse.ProtoReflect.Descriptor instead.

func (*DirectResponse) GetBody

func (x *DirectResponse) GetBody() string

func (*DirectResponse) GetCode

func (x *DirectResponse) GetCode() uint32

func (*DirectResponse) ProtoMessage

func (*DirectResponse) ProtoMessage()

func (*DirectResponse) ProtoReflect

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

func (*DirectResponse) Reset

func (x *DirectResponse) Reset()

func (*DirectResponse) String

func (x *DirectResponse) String() string

func (*DirectResponse) Validate

func (m *DirectResponse) Validate() error

Validate checks the field values on DirectResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*DirectResponse) ValidateAll

func (m *DirectResponse) ValidateAll() error

ValidateAll checks the field values on DirectResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in DirectResponseMultiError, or nil if none found.

type DirectResponseMultiError

type DirectResponseMultiError []error

DirectResponseMultiError is an error wrapping multiple validation errors returned by DirectResponse.ValidateAll() if the designated constraints aren't met.

func (DirectResponseMultiError) AllErrors

func (m DirectResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DirectResponseMultiError) Error

func (m DirectResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type DirectResponseValidationError

type DirectResponseValidationError struct {
	// contains filtered or unexported fields
}

DirectResponseValidationError is the validation error returned by DirectResponse.Validate if the designated constraints aren't met.

func (DirectResponseValidationError) Cause

Cause function returns cause value.

func (DirectResponseValidationError) Error

Error satisfies the builtin error interface

func (DirectResponseValidationError) ErrorName

func (e DirectResponseValidationError) ErrorName() string

ErrorName returns error name.

func (DirectResponseValidationError) Field

Field function returns field value.

func (DirectResponseValidationError) Key

Key function returns key value.

func (DirectResponseValidationError) Reason

Reason function returns reason value.

type Forward

type Forward struct {
	Cors    *Cors    `protobuf:"bytes,1,opt,name=cors,proto3" json:"cors,omitempty"`
	Rewrite *Rewrite `protobuf:"bytes,2,opt,name=rewrite,proto3" json:"rewrite,omitempty"`
	Limiter *Limiter `protobuf:"bytes,9,opt,name=limiter,proto3" json:"limiter,omitempty"`
	// contains filtered or unexported fields
}

func (*Forward) Descriptor deprecated

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

Deprecated: Use Forward.ProtoReflect.Descriptor instead.

func (*Forward) GetCors

func (x *Forward) GetCors() *Cors

func (*Forward) GetLimiter

func (x *Forward) GetLimiter() *Limiter

func (*Forward) GetRewrite

func (x *Forward) GetRewrite() *Rewrite

func (*Forward) ProtoMessage

func (*Forward) ProtoMessage()

func (*Forward) ProtoReflect

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

func (*Forward) Reset

func (x *Forward) Reset()

func (*Forward) String

func (x *Forward) String() string

func (*Forward) Validate

func (m *Forward) Validate() error

Validate checks the field values on Forward with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Forward) ValidateAll

func (m *Forward) ValidateAll() error

ValidateAll checks the field values on Forward with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ForwardMultiError, or nil if none found.

type ForwardMultiError

type ForwardMultiError []error

ForwardMultiError is an error wrapping multiple validation errors returned by Forward.ValidateAll() if the designated constraints aren't met.

func (ForwardMultiError) AllErrors

func (m ForwardMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ForwardMultiError) Error

func (m ForwardMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ForwardValidationError

type ForwardValidationError struct {
	// contains filtered or unexported fields
}

ForwardValidationError is the validation error returned by Forward.Validate if the designated constraints aren't met.

func (ForwardValidationError) Cause

func (e ForwardValidationError) Cause() error

Cause function returns cause value.

func (ForwardValidationError) Error

func (e ForwardValidationError) Error() string

Error satisfies the builtin error interface

func (ForwardValidationError) ErrorName

func (e ForwardValidationError) ErrorName() string

ErrorName returns error name.

func (ForwardValidationError) Field

func (e ForwardValidationError) Field() string

Field function returns field value.

func (ForwardValidationError) Key

func (e ForwardValidationError) Key() bool

Key function returns key value.

func (ForwardValidationError) Reason

func (e ForwardValidationError) Reason() string

Reason function returns reason value.

type Limiter

type Limiter struct {
	Enabled bool   `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	Qps     uint32 `protobuf:"varint,2,opt,name=qps,proto3" json:"qps,omitempty"`
	// contains filtered or unexported fields
}

func (*Limiter) Descriptor deprecated

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

Deprecated: Use Limiter.ProtoReflect.Descriptor instead.

func (*Limiter) GetEnabled

func (x *Limiter) GetEnabled() bool

func (*Limiter) GetQps

func (x *Limiter) GetQps() uint32

func (*Limiter) ProtoMessage

func (*Limiter) ProtoMessage()

func (*Limiter) ProtoReflect

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

func (*Limiter) Reset

func (x *Limiter) Reset()

func (*Limiter) String

func (x *Limiter) String() string

func (*Limiter) Validate

func (m *Limiter) Validate() error

Validate checks the field values on Limiter with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Limiter) ValidateAll

func (m *Limiter) ValidateAll() error

ValidateAll checks the field values on Limiter with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in LimiterMultiError, or nil if none found.

type LimiterMultiError

type LimiterMultiError []error

LimiterMultiError is an error wrapping multiple validation errors returned by Limiter.ValidateAll() if the designated constraints aren't met.

func (LimiterMultiError) AllErrors

func (m LimiterMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (LimiterMultiError) Error

func (m LimiterMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type LimiterValidationError

type LimiterValidationError struct {
	// contains filtered or unexported fields
}

LimiterValidationError is the validation error returned by Limiter.Validate if the designated constraints aren't met.

func (LimiterValidationError) Cause

func (e LimiterValidationError) Cause() error

Cause function returns cause value.

func (LimiterValidationError) Error

func (e LimiterValidationError) Error() string

Error satisfies the builtin error interface

func (LimiterValidationError) ErrorName

func (e LimiterValidationError) ErrorName() string

ErrorName returns error name.

func (LimiterValidationError) Field

func (e LimiterValidationError) Field() string

Field function returns field value.

func (LimiterValidationError) Key

func (e LimiterValidationError) Key() bool

Key function returns key value.

func (LimiterValidationError) Reason

func (e LimiterValidationError) Reason() string

Reason function returns reason value.

type Limiter_Fallback

type Limiter_Fallback struct {
	Status   uint32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"`
	Body     string `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"`
	Redirect string `protobuf:"bytes,4,opt,name=redirect,proto3" json:"redirect,omitempty"`
	// contains filtered or unexported fields
}

func (*Limiter_Fallback) Descriptor deprecated

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

Deprecated: Use Limiter_Fallback.ProtoReflect.Descriptor instead.

func (*Limiter_Fallback) GetBody

func (x *Limiter_Fallback) GetBody() string

func (*Limiter_Fallback) GetRedirect

func (x *Limiter_Fallback) GetRedirect() string

func (*Limiter_Fallback) GetStatus

func (x *Limiter_Fallback) GetStatus() uint32

func (*Limiter_Fallback) ProtoMessage

func (*Limiter_Fallback) ProtoMessage()

func (*Limiter_Fallback) ProtoReflect

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

func (*Limiter_Fallback) Reset

func (x *Limiter_Fallback) Reset()

func (*Limiter_Fallback) String

func (x *Limiter_Fallback) String() string

func (*Limiter_Fallback) Validate

func (m *Limiter_Fallback) Validate() error

Validate checks the field values on Limiter_Fallback with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Limiter_Fallback) ValidateAll

func (m *Limiter_Fallback) ValidateAll() error

ValidateAll checks the field values on Limiter_Fallback with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in Limiter_FallbackMultiError, or nil if none found.

type Limiter_FallbackMultiError

type Limiter_FallbackMultiError []error

Limiter_FallbackMultiError is an error wrapping multiple validation errors returned by Limiter_Fallback.ValidateAll() if the designated constraints aren't met.

func (Limiter_FallbackMultiError) AllErrors

func (m Limiter_FallbackMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (Limiter_FallbackMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type Limiter_FallbackValidationError

type Limiter_FallbackValidationError struct {
	// contains filtered or unexported fields
}

Limiter_FallbackValidationError is the validation error returned by Limiter_Fallback.Validate if the designated constraints aren't met.

func (Limiter_FallbackValidationError) Cause

Cause function returns cause value.

func (Limiter_FallbackValidationError) Error

Error satisfies the builtin error interface

func (Limiter_FallbackValidationError) ErrorName

ErrorName returns error name.

func (Limiter_FallbackValidationError) Field

Field function returns field value.

func (Limiter_FallbackValidationError) Key

Key function returns key value.

func (Limiter_FallbackValidationError) Reason

Reason function returns reason value.

type ListRequest

type ListRequest struct {
	Appid string `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"`
	// contains filtered or unexported fields
}

func (*ListRequest) Descriptor deprecated

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

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetAppid

func (x *ListRequest) GetAppid() string

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

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

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

func (*ListRequest) Validate

func (m *ListRequest) Validate() error

Validate checks the field values on ListRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ListRequest) ValidateAll

func (m *ListRequest) ValidateAll() error

ValidateAll checks the field values on ListRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ListRequestMultiError, or nil if none found.

type ListRequestMultiError

type ListRequestMultiError []error

ListRequestMultiError is an error wrapping multiple validation errors returned by ListRequest.ValidateAll() if the designated constraints aren't met.

func (ListRequestMultiError) AllErrors

func (m ListRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListRequestMultiError) Error

func (m ListRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ListRequestValidationError

type ListRequestValidationError struct {
	// contains filtered or unexported fields
}

ListRequestValidationError is the validation error returned by ListRequest.Validate if the designated constraints aren't met.

func (ListRequestValidationError) Cause

Cause function returns cause value.

func (ListRequestValidationError) Error

Error satisfies the builtin error interface

func (ListRequestValidationError) ErrorName

func (e ListRequestValidationError) ErrorName() string

ErrorName returns error name.

func (ListRequestValidationError) Field

Field function returns field value.

func (ListRequestValidationError) Key

Key function returns key value.

func (ListRequestValidationError) Reason

Reason function returns reason value.

type ListResponse

type ListResponse struct {
	Items []*Route `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	Total int64    `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResponse) Descriptor deprecated

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

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetItems

func (x *ListResponse) GetItems() []*Route

func (*ListResponse) GetTotal

func (x *ListResponse) GetTotal() int64

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

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

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

func (*ListResponse) Validate

func (m *ListResponse) Validate() error

Validate checks the field values on ListResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ListResponse) ValidateAll

func (m *ListResponse) ValidateAll() error

ValidateAll checks the field values on ListResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ListResponseMultiError, or nil if none found.

type ListResponseMultiError

type ListResponseMultiError []error

ListResponseMultiError is an error wrapping multiple validation errors returned by ListResponse.ValidateAll() if the designated constraints aren't met.

func (ListResponseMultiError) AllErrors

func (m ListResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListResponseMultiError) Error

func (m ListResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ListResponseValidationError

type ListResponseValidationError struct {
	// contains filtered or unexported fields
}

ListResponseValidationError is the validation error returned by ListResponse.Validate if the designated constraints aren't met.

func (ListResponseValidationError) Cause

Cause function returns cause value.

func (ListResponseValidationError) Error

Error satisfies the builtin error interface

func (ListResponseValidationError) ErrorName

func (e ListResponseValidationError) ErrorName() string

ErrorName returns error name.

func (ListResponseValidationError) Field

Field function returns field value.

func (ListResponseValidationError) Key

Key function returns key value.

func (ListResponseValidationError) Reason

Reason function returns reason value.

type Redirect

type Redirect struct {
	Code uint32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"`
	Url  string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"`
	// contains filtered or unexported fields
}

func (*Redirect) Descriptor deprecated

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

Deprecated: Use Redirect.ProtoReflect.Descriptor instead.

func (*Redirect) GetCode

func (x *Redirect) GetCode() uint32

func (*Redirect) GetUrl

func (x *Redirect) GetUrl() string

func (*Redirect) ProtoMessage

func (*Redirect) ProtoMessage()

func (*Redirect) ProtoReflect

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

func (*Redirect) Reset

func (x *Redirect) Reset()

func (*Redirect) String

func (x *Redirect) String() string

func (*Redirect) Validate

func (m *Redirect) Validate() error

Validate checks the field values on Redirect with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Redirect) ValidateAll

func (m *Redirect) ValidateAll() error

ValidateAll checks the field values on Redirect with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in RedirectMultiError, or nil if none found.

type RedirectMultiError

type RedirectMultiError []error

RedirectMultiError is an error wrapping multiple validation errors returned by Redirect.ValidateAll() if the designated constraints aren't met.

func (RedirectMultiError) AllErrors

func (m RedirectMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RedirectMultiError) Error

func (m RedirectMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type RedirectValidationError

type RedirectValidationError struct {
	// contains filtered or unexported fields
}

RedirectValidationError is the validation error returned by Redirect.Validate if the designated constraints aren't met.

func (RedirectValidationError) Cause

func (e RedirectValidationError) Cause() error

Cause function returns cause value.

func (RedirectValidationError) Error

func (e RedirectValidationError) Error() string

Error satisfies the builtin error interface

func (RedirectValidationError) ErrorName

func (e RedirectValidationError) ErrorName() string

ErrorName returns error name.

func (RedirectValidationError) Field

func (e RedirectValidationError) Field() string

Field function returns field value.

func (RedirectValidationError) Key

func (e RedirectValidationError) Key() bool

Key function returns key value.

func (RedirectValidationError) Reason

func (e RedirectValidationError) Reason() string

Reason function returns reason value.

type Rewrite

type Rewrite struct {
	Enabled   bool   `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	Uri       string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"`
	Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"`
	// contains filtered or unexported fields
}

func (*Rewrite) Descriptor deprecated

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

Deprecated: Use Rewrite.ProtoReflect.Descriptor instead.

func (*Rewrite) GetAuthority

func (x *Rewrite) GetAuthority() string

func (*Rewrite) GetEnabled

func (x *Rewrite) GetEnabled() bool

func (*Rewrite) GetUri

func (x *Rewrite) GetUri() string

func (*Rewrite) ProtoMessage

func (*Rewrite) ProtoMessage()

func (*Rewrite) ProtoReflect

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

func (*Rewrite) Reset

func (x *Rewrite) Reset()

func (*Rewrite) String

func (x *Rewrite) String() string

func (*Rewrite) Validate

func (m *Rewrite) Validate() error

Validate checks the field values on Rewrite with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Rewrite) ValidateAll

func (m *Rewrite) ValidateAll() error

ValidateAll checks the field values on Rewrite with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in RewriteMultiError, or nil if none found.

type RewriteMultiError

type RewriteMultiError []error

RewriteMultiError is an error wrapping multiple validation errors returned by Rewrite.ValidateAll() if the designated constraints aren't met.

func (RewriteMultiError) AllErrors

func (m RewriteMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RewriteMultiError) Error

func (m RewriteMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type RewriteValidationError

type RewriteValidationError struct {
	// contains filtered or unexported fields
}

RewriteValidationError is the validation error returned by Rewrite.Validate if the designated constraints aren't met.

func (RewriteValidationError) Cause

func (e RewriteValidationError) Cause() error

Cause function returns cause value.

func (RewriteValidationError) Error

func (e RewriteValidationError) Error() string

Error satisfies the builtin error interface

func (RewriteValidationError) ErrorName

func (e RewriteValidationError) ErrorName() string

ErrorName returns error name.

func (RewriteValidationError) Field

func (e RewriteValidationError) Field() string

Field function returns field value.

func (RewriteValidationError) Key

func (e RewriteValidationError) Key() bool

Key function returns key value.

func (RewriteValidationError) Reason

func (e RewriteValidationError) Reason() string

Reason function returns reason value.

type Route

type Route struct {
	Id        string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" bson:"_id,omitempty"` // @gotags: bson:"_id,omitempty"
	Appid     string                 `protobuf:"bytes,2,opt,name=appid,proto3" json:"appid,omitempty"`
	Path      string                 `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"`
	Methods   []string               `protobuf:"bytes,6,rep,name=methods,proto3" json:"methods,omitempty"`
	Type      Route_Type             `protobuf:"varint,7,opt,name=type,proto3,enum=route.Route_Type" json:"type,omitempty"`
	Forward   *Forward               `protobuf:"bytes,10,opt,name=forward,proto3" json:"forward,omitempty"`
	Redirect  *Redirect              `protobuf:"bytes,11,opt,name=redirect,proto3" json:"redirect,omitempty"`
	Mock      *DirectResponse        `protobuf:"bytes,12,opt,name=mock,proto3" json:"mock,omitempty"`
	Status    kiae.OpStatus          `protobuf:"varint,20,opt,name=status,proto3,enum=kiae.OpStatus" json:"status,omitempty"`
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,101,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	CreatedBy *timestamppb.Timestamp `protobuf:"bytes,102,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"`
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,103,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	UpdatedBy *timestamppb.Timestamp `protobuf:"bytes,104,opt,name=updated_by,json=updatedBy,proto3" json:"updated_by,omitempty"`
	// contains filtered or unexported fields
}

func (*Route) Descriptor deprecated

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

Deprecated: Use Route.ProtoReflect.Descriptor instead.

func (*Route) GetAppid

func (x *Route) GetAppid() string

func (*Route) GetCreatedAt

func (x *Route) GetCreatedAt() *timestamppb.Timestamp

func (*Route) GetCreatedBy

func (x *Route) GetCreatedBy() *timestamppb.Timestamp

func (*Route) GetForward

func (x *Route) GetForward() *Forward

func (*Route) GetId

func (x *Route) GetId() string

func (*Route) GetMethods

func (x *Route) GetMethods() []string

func (*Route) GetMock

func (x *Route) GetMock() *DirectResponse

func (*Route) GetPath

func (x *Route) GetPath() string

func (*Route) GetRedirect

func (x *Route) GetRedirect() *Redirect

func (*Route) GetStatus

func (x *Route) GetStatus() kiae.OpStatus

func (*Route) GetType

func (x *Route) GetType() Route_Type

func (*Route) GetUpdatedAt

func (x *Route) GetUpdatedAt() *timestamppb.Timestamp

func (*Route) GetUpdatedBy

func (x *Route) GetUpdatedBy() *timestamppb.Timestamp

func (*Route) ProtoMessage

func (*Route) ProtoMessage()

func (*Route) ProtoReflect

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

func (*Route) Reset

func (x *Route) Reset()

func (*Route) String

func (x *Route) String() string

func (*Route) Validate

func (m *Route) Validate() error

Validate checks the field values on Route with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Route) ValidateAll

func (m *Route) ValidateAll() error

ValidateAll checks the field values on Route with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in RouteMultiError, or nil if none found.

type RouteMultiError

type RouteMultiError []error

RouteMultiError is an error wrapping multiple validation errors returned by Route.ValidateAll() if the designated constraints aren't met.

func (RouteMultiError) AllErrors

func (m RouteMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RouteMultiError) Error

func (m RouteMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type RouteServiceClient

type RouteServiceClient interface {
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
	Create(ctx context.Context, in *Route, opts ...grpc.CallOption) (*Route, error)
	Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*Route, error)
	Delete(ctx context.Context, in *kiae.IdRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

RouteServiceClient is the client API for RouteService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type RouteServiceServer

type RouteServiceServer interface {
	List(context.Context, *ListRequest) (*ListResponse, error)
	Create(context.Context, *Route) (*Route, error)
	Update(context.Context, *UpdateRequest) (*Route, error)
	Delete(context.Context, *kiae.IdRequest) (*emptypb.Empty, error)
}

RouteServiceServer is the server API for RouteService service. All implementations should embed UnimplementedRouteServiceServer for forward compatibility

type RouteValidationError

type RouteValidationError struct {
	// contains filtered or unexported fields
}

RouteValidationError is the validation error returned by Route.Validate if the designated constraints aren't met.

func (RouteValidationError) Cause

func (e RouteValidationError) Cause() error

Cause function returns cause value.

func (RouteValidationError) Error

func (e RouteValidationError) Error() string

Error satisfies the builtin error interface

func (RouteValidationError) ErrorName

func (e RouteValidationError) ErrorName() string

ErrorName returns error name.

func (RouteValidationError) Field

func (e RouteValidationError) Field() string

Field function returns field value.

func (RouteValidationError) Key

func (e RouteValidationError) Key() bool

Key function returns key value.

func (RouteValidationError) Reason

func (e RouteValidationError) Reason() string

Reason function returns reason value.

type Route_Type

type Route_Type int32
const (
	Route_FORWARD         Route_Type = 0
	Route_REDIRECT        Route_Type = 1
	Route_DIRECT_RESPONSE Route_Type = 2
)

func (Route_Type) Descriptor

func (Route_Type) Descriptor() protoreflect.EnumDescriptor

func (Route_Type) Enum

func (x Route_Type) Enum() *Route_Type

func (Route_Type) EnumDescriptor deprecated

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

Deprecated: Use Route_Type.Descriptor instead.

func (Route_Type) Number

func (x Route_Type) Number() protoreflect.EnumNumber

func (Route_Type) String

func (x Route_Type) String() string

func (Route_Type) Type

type UnimplementedRouteServiceServer

type UnimplementedRouteServiceServer struct {
}

UnimplementedRouteServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedRouteServiceServer) Create

func (UnimplementedRouteServiceServer) Delete

func (UnimplementedRouteServiceServer) List

func (UnimplementedRouteServiceServer) Update

type UnsafeRouteServiceServer

type UnsafeRouteServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeRouteServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RouteServiceServer will result in compilation errors.

type UpdateRequest

type UpdateRequest struct {
	Payload    *Route                 `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
	UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateRequest) Descriptor deprecated

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

Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.

func (*UpdateRequest) GetPayload

func (x *UpdateRequest) GetPayload() *Route

func (*UpdateRequest) GetUpdateMask

func (x *UpdateRequest) GetUpdateMask() *fieldmaskpb.FieldMask

func (*UpdateRequest) ProtoMessage

func (*UpdateRequest) ProtoMessage()

func (*UpdateRequest) ProtoReflect

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

func (*UpdateRequest) Reset

func (x *UpdateRequest) Reset()

func (*UpdateRequest) String

func (x *UpdateRequest) String() string

func (*UpdateRequest) Validate

func (m *UpdateRequest) Validate() error

Validate checks the field values on UpdateRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*UpdateRequest) ValidateAll

func (m *UpdateRequest) ValidateAll() error

ValidateAll checks the field values on UpdateRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UpdateRequestMultiError, or nil if none found.

type UpdateRequestMultiError

type UpdateRequestMultiError []error

UpdateRequestMultiError is an error wrapping multiple validation errors returned by UpdateRequest.ValidateAll() if the designated constraints aren't met.

func (UpdateRequestMultiError) AllErrors

func (m UpdateRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UpdateRequestMultiError) Error

func (m UpdateRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type UpdateRequestValidationError

type UpdateRequestValidationError struct {
	// contains filtered or unexported fields
}

UpdateRequestValidationError is the validation error returned by UpdateRequest.Validate if the designated constraints aren't met.

func (UpdateRequestValidationError) Cause

Cause function returns cause value.

func (UpdateRequestValidationError) Error

Error satisfies the builtin error interface

func (UpdateRequestValidationError) ErrorName

func (e UpdateRequestValidationError) ErrorName() string

ErrorName returns error name.

func (UpdateRequestValidationError) Field

Field function returns field value.

func (UpdateRequestValidationError) Key

Key function returns key value.

func (UpdateRequestValidationError) Reason

Reason function returns reason value.

Jump to

Keyboard shortcuts

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