Documentation ¶
Overview ¶
Package egress is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterEgressServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterEgressServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EgressServiceClient) error
- func RegisterEgressServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterEgressServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EgressServiceServer) error
- func RegisterEgressServiceServer(s grpc.ServiceRegistrar, srv EgressServiceServer)
- type Egress
- func (*Egress) Descriptor() ([]byte, []int)deprecated
- func (x *Egress) GetAppid() string
- func (x *Egress) GetCreatedAt() *timestamppb.Timestamp
- func (x *Egress) GetHost() string
- func (x *Egress) GetId() string
- func (x *Egress) GetName() string
- func (x *Egress) GetPorts() []*Port
- func (x *Egress) GetStatus() kiae.OpStatus
- func (x *Egress) GetType() Egress_Type
- func (x *Egress) GetUpdatedAt() *timestamppb.Timestamp
- func (*Egress) ProtoMessage()
- func (x *Egress) ProtoReflect() protoreflect.Message
- func (x *Egress) Reset()
- func (x *Egress) String() string
- func (m *Egress) Validate() error
- func (m *Egress) ValidateAll() error
- type EgressMultiError
- type EgressServiceClient
- type EgressServiceServer
- type EgressValidationError
- type Egress_Type
- func (Egress_Type) Descriptor() protoreflect.EnumDescriptor
- func (x Egress_Type) Enum() *Egress_Type
- func (Egress_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x Egress_Type) Number() protoreflect.EnumNumber
- func (x Egress_Type) String() string
- func (Egress_Type) Type() protoreflect.EnumType
- type ListRequest
- func (*ListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListRequest) GetAppid() string
- func (x *ListRequest) GetName() string
- func (*ListRequest) ProtoMessage()
- func (x *ListRequest) ProtoReflect() protoreflect.Message
- func (x *ListRequest) Reset()
- func (x *ListRequest) String() string
- func (m *ListRequest) Validate() error
- func (m *ListRequest) ValidateAll() error
- type ListRequestMultiError
- type ListRequestValidationError
- func (e ListRequestValidationError) Cause() error
- func (e ListRequestValidationError) Error() string
- func (e ListRequestValidationError) ErrorName() string
- func (e ListRequestValidationError) Field() string
- func (e ListRequestValidationError) Key() bool
- func (e ListRequestValidationError) Reason() string
- type ListResponse
- func (*ListResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListResponse) GetItems() []*Egress
- func (x *ListResponse) GetTotal() int64
- func (*ListResponse) ProtoMessage()
- func (x *ListResponse) ProtoReflect() protoreflect.Message
- func (x *ListResponse) Reset()
- func (x *ListResponse) String() string
- func (m *ListResponse) Validate() error
- func (m *ListResponse) ValidateAll() error
- type ListResponseMultiError
- type ListResponseValidationError
- func (e ListResponseValidationError) Cause() error
- func (e ListResponseValidationError) Error() string
- func (e ListResponseValidationError) ErrorName() string
- func (e ListResponseValidationError) Field() string
- func (e ListResponseValidationError) Key() bool
- func (e ListResponseValidationError) Reason() string
- type Port
- func (*Port) Descriptor() ([]byte, []int)deprecated
- func (x *Port) GetNumber() uint32
- func (x *Port) GetProtocol() string
- func (*Port) ProtoMessage()
- func (x *Port) ProtoReflect() protoreflect.Message
- func (x *Port) Reset()
- func (x *Port) String() string
- func (m *Port) Validate() error
- func (m *Port) ValidateAll() error
- type PortMultiError
- type PortValidationError
- type UnimplementedEgressServiceServer
- func (UnimplementedEgressServiceServer) Create(context.Context, *Egress) (*Egress, error)
- func (UnimplementedEgressServiceServer) Delete(context.Context, *kiae.IdRequest) (*emptypb.Empty, error)
- func (UnimplementedEgressServiceServer) List(context.Context, *ListRequest) (*ListResponse, error)
- func (UnimplementedEgressServiceServer) Update(context.Context, *Egress) (*Egress, error)
- type UnsafeEgressServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( Egress_Type_name = map[int32]string{ 0: "INTERNAL", 1: "INTERNET", } Egress_Type_value = map[string]int32{ "INTERNAL": 0, "INTERNET": 1, } )
Enum value maps for Egress_Type.
var EgressService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "egress.EgressService", HandlerType: (*EgressServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "List", Handler: _EgressService_List_Handler, }, { MethodName: "Create", Handler: _EgressService_Create_Handler, }, { MethodName: "Update", Handler: _EgressService_Update_Handler, }, { MethodName: "Delete", Handler: _EgressService_Delete_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "egress/egress.proto", }
EgressService_ServiceDesc is the grpc.ServiceDesc for EgressService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_egress_egress_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEgressServiceHandler ¶
func RegisterEgressServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterEgressServiceHandler registers the http handlers for service EgressService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterEgressServiceHandlerClient ¶
func RegisterEgressServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EgressServiceClient) error
RegisterEgressServiceHandlerClient registers the http handlers for service EgressService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "EgressServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "EgressServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "EgressServiceClient" to call the correct interceptors.
func RegisterEgressServiceHandlerFromEndpoint ¶
func RegisterEgressServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterEgressServiceHandlerFromEndpoint is same as RegisterEgressServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterEgressServiceHandlerServer ¶
func RegisterEgressServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EgressServiceServer) error
RegisterEgressServiceHandlerServer registers the http handlers for service EgressService to "mux". UnaryRPC :call EgressServiceServer 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 RegisterEgressServiceHandlerFromEndpoint instead.
func RegisterEgressServiceServer ¶
func RegisterEgressServiceServer(s grpc.ServiceRegistrar, srv EgressServiceServer)
Types ¶
type Egress ¶
type Egress 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"` Type Egress_Type `protobuf:"varint,5,opt,name=type,proto3,enum=egress.Egress_Type" json:"type,omitempty"` Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` Host string `protobuf:"bytes,7,opt,name=host,proto3" json:"host,omitempty"` Ports []*Port `protobuf:"bytes,8,rep,name=ports,proto3" json:"ports,omitempty"` Status kiae.OpStatus `protobuf:"varint,10,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" bson:"created_at,omitempty"` // @gotags: bson:"created_at,omitempty" UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,103,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty" bson:"updated_at,omitempty"` // @gotags: bson:"updated_at,omitempty" // contains filtered or unexported fields }
func (*Egress) Descriptor
deprecated
func (*Egress) GetCreatedAt ¶
func (x *Egress) GetCreatedAt() *timestamppb.Timestamp
func (*Egress) GetType ¶
func (x *Egress) GetType() Egress_Type
func (*Egress) GetUpdatedAt ¶
func (x *Egress) GetUpdatedAt() *timestamppb.Timestamp
func (*Egress) ProtoMessage ¶
func (*Egress) ProtoMessage()
func (*Egress) ProtoReflect ¶
func (x *Egress) ProtoReflect() protoreflect.Message
func (*Egress) Validate ¶
Validate checks the field values on Egress 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 (*Egress) ValidateAll ¶
ValidateAll checks the field values on Egress 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 EgressMultiError, or nil if none found.
type EgressMultiError ¶
type EgressMultiError []error
EgressMultiError is an error wrapping multiple validation errors returned by Egress.ValidateAll() if the designated constraints aren't met.
func (EgressMultiError) AllErrors ¶
func (m EgressMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (EgressMultiError) Error ¶
func (m EgressMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type EgressServiceClient ¶
type EgressServiceClient interface { List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) Create(ctx context.Context, in *Egress, opts ...grpc.CallOption) (*Egress, error) Update(ctx context.Context, in *Egress, opts ...grpc.CallOption) (*Egress, error) Delete(ctx context.Context, in *kiae.IdRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) }
EgressServiceClient is the client API for EgressService 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.
func NewEgressServiceClient ¶
func NewEgressServiceClient(cc grpc.ClientConnInterface) EgressServiceClient
type EgressServiceServer ¶
type EgressServiceServer interface { List(context.Context, *ListRequest) (*ListResponse, error) Create(context.Context, *Egress) (*Egress, error) Update(context.Context, *Egress) (*Egress, error) Delete(context.Context, *kiae.IdRequest) (*emptypb.Empty, error) }
EgressServiceServer is the server API for EgressService service. All implementations should embed UnimplementedEgressServiceServer for forward compatibility
type EgressValidationError ¶
type EgressValidationError struct {
// contains filtered or unexported fields
}
EgressValidationError is the validation error returned by Egress.Validate if the designated constraints aren't met.
func (EgressValidationError) Cause ¶
func (e EgressValidationError) Cause() error
Cause function returns cause value.
func (EgressValidationError) Error ¶
func (e EgressValidationError) Error() string
Error satisfies the builtin error interface
func (EgressValidationError) ErrorName ¶
func (e EgressValidationError) ErrorName() string
ErrorName returns error name.
func (EgressValidationError) Field ¶
func (e EgressValidationError) Field() string
Field function returns field value.
func (EgressValidationError) Key ¶
func (e EgressValidationError) Key() bool
Key function returns key value.
func (EgressValidationError) Reason ¶
func (e EgressValidationError) Reason() string
Reason function returns reason value.
type Egress_Type ¶
type Egress_Type int32
const ( Egress_INTERNAL Egress_Type = 0 Egress_INTERNET Egress_Type = 1 )
func (Egress_Type) Descriptor ¶
func (Egress_Type) Descriptor() protoreflect.EnumDescriptor
func (Egress_Type) Enum ¶
func (x Egress_Type) Enum() *Egress_Type
func (Egress_Type) EnumDescriptor
deprecated
func (Egress_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use Egress_Type.Descriptor instead.
func (Egress_Type) Number ¶
func (x Egress_Type) Number() protoreflect.EnumNumber
func (Egress_Type) String ¶
func (x Egress_Type) String() string
func (Egress_Type) Type ¶
func (Egress_Type) Type() protoreflect.EnumType
type ListRequest ¶
type ListRequest struct { Appid string `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,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) GetName ¶
func (x *ListRequest) GetName() 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 ¶
func (e ListRequestValidationError) Cause() error
Cause function returns cause value.
func (ListRequestValidationError) Error ¶
func (e ListRequestValidationError) Error() string
Error satisfies the builtin error interface
func (ListRequestValidationError) ErrorName ¶
func (e ListRequestValidationError) ErrorName() string
ErrorName returns error name.
func (ListRequestValidationError) Field ¶
func (e ListRequestValidationError) Field() string
Field function returns field value.
func (ListRequestValidationError) Key ¶
func (e ListRequestValidationError) Key() bool
Key function returns key value.
func (ListRequestValidationError) Reason ¶
func (e ListRequestValidationError) Reason() string
Reason function returns reason value.
type ListResponse ¶
type ListResponse struct { Items []*Egress `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() []*Egress
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 ¶
func (e ListResponseValidationError) Cause() error
Cause function returns cause value.
func (ListResponseValidationError) Error ¶
func (e ListResponseValidationError) Error() string
Error satisfies the builtin error interface
func (ListResponseValidationError) ErrorName ¶
func (e ListResponseValidationError) ErrorName() string
ErrorName returns error name.
func (ListResponseValidationError) Field ¶
func (e ListResponseValidationError) Field() string
Field function returns field value.
func (ListResponseValidationError) Key ¶
func (e ListResponseValidationError) Key() bool
Key function returns key value.
func (ListResponseValidationError) Reason ¶
func (e ListResponseValidationError) Reason() string
Reason function returns reason value.
type Port ¶
type Port struct { Number uint32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` Protocol string `protobuf:"bytes,2,opt,name=protocol,proto3" json:"protocol,omitempty"` // contains filtered or unexported fields }
func (*Port) Descriptor
deprecated
func (*Port) GetProtocol ¶
func (*Port) ProtoMessage ¶
func (*Port) ProtoMessage()
func (*Port) ProtoReflect ¶
func (x *Port) ProtoReflect() protoreflect.Message
func (*Port) Validate ¶
Validate checks the field values on Port 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 (*Port) ValidateAll ¶
ValidateAll checks the field values on Port 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 PortMultiError, or nil if none found.
type PortMultiError ¶
type PortMultiError []error
PortMultiError is an error wrapping multiple validation errors returned by Port.ValidateAll() if the designated constraints aren't met.
func (PortMultiError) AllErrors ¶
func (m PortMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (PortMultiError) Error ¶
func (m PortMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type PortValidationError ¶
type PortValidationError struct {
// contains filtered or unexported fields
}
PortValidationError is the validation error returned by Port.Validate if the designated constraints aren't met.
func (PortValidationError) Cause ¶
func (e PortValidationError) Cause() error
Cause function returns cause value.
func (PortValidationError) Error ¶
func (e PortValidationError) Error() string
Error satisfies the builtin error interface
func (PortValidationError) ErrorName ¶
func (e PortValidationError) ErrorName() string
ErrorName returns error name.
func (PortValidationError) Field ¶
func (e PortValidationError) Field() string
Field function returns field value.
func (PortValidationError) Key ¶
func (e PortValidationError) Key() bool
Key function returns key value.
func (PortValidationError) Reason ¶
func (e PortValidationError) Reason() string
Reason function returns reason value.
type UnimplementedEgressServiceServer ¶
type UnimplementedEgressServiceServer struct { }
UnimplementedEgressServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedEgressServiceServer) List ¶
func (UnimplementedEgressServiceServer) List(context.Context, *ListRequest) (*ListResponse, error)
type UnsafeEgressServiceServer ¶
type UnsafeEgressServiceServer interface {
// contains filtered or unexported methods
}
UnsafeEgressServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EgressServiceServer will result in compilation errors.