entry

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: 32 Imported by: 0

Documentation

Overview

Package entry is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Entry_Scope_name = map[int32]string{
		0: "ALL",
		1: "PARTIAL",
	}
	Entry_Scope_value = map[string]int32{
		"ALL":     0,
		"PARTIAL": 1,
	}
)

Enum value maps for Entry_Scope.

View Source
var EntryService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "entry.EntryService",
	HandlerType: (*EntryServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _EntryService_List_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _EntryService_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _EntryService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _EntryService_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "entry/entry.proto",
}

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

View Source
var File_entry_entry_proto protoreflect.FileDescriptor

Functions

func RegisterEntryServiceHandler

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

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

func RegisterEntryServiceHandlerClient

func RegisterEntryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EntryServiceClient) error

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

func RegisterEntryServiceHandlerFromEndpoint

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

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

func RegisterEntryServiceHandlerServer

func RegisterEntryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EntryServiceServer) error

RegisterEntryServiceHandlerServer registers the http handlers for service EntryService to "mux". UnaryRPC :call EntryServiceServer 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 RegisterEntryServiceHandlerFromEndpoint instead.

func RegisterEntryServiceServer

func RegisterEntryServiceServer(s grpc.ServiceRegistrar, srv EntryServiceServer)

Types

type Entry

type Entry 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"`
	Gateway   string                 `protobuf:"bytes,4,opt,name=gateway,proto3" json:"gateway,omitempty"`
	Host      string                 `protobuf:"bytes,5,opt,name=host,proto3" json:"host,omitempty"`
	Scope     Entry_Scope            `protobuf:"varint,6,opt,name=scope,proto3,enum=entry.Entry_Scope" json:"scope,omitempty"`
	RouteIds  []string               `protobuf:"bytes,7,rep,name=route_ids,json=routeIds,proto3" json:"route_ids,omitempty"`
	Status    kiae.OpStatus          `protobuf:"varint,8,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"`
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,103,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Entry) Descriptor deprecated

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

Deprecated: Use Entry.ProtoReflect.Descriptor instead.

func (*Entry) GetAppid

func (x *Entry) GetAppid() string

func (*Entry) GetCreatedAt

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

func (*Entry) GetGateway

func (x *Entry) GetGateway() string

func (*Entry) GetHost

func (x *Entry) GetHost() string

func (*Entry) GetId

func (x *Entry) GetId() string

func (*Entry) GetRouteIds

func (x *Entry) GetRouteIds() []string

func (*Entry) GetScope

func (x *Entry) GetScope() Entry_Scope

func (*Entry) GetStatus

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

func (*Entry) GetUpdatedAt

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

func (*Entry) ProtoMessage

func (*Entry) ProtoMessage()

func (*Entry) ProtoReflect

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

func (*Entry) Reset

func (x *Entry) Reset()

func (*Entry) String

func (x *Entry) String() string

func (*Entry) Validate

func (m *Entry) Validate() error

Validate checks the field values on Entry 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 (*Entry) ValidateAll

func (m *Entry) ValidateAll() error

ValidateAll checks the field values on Entry 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 EntryMultiError, or nil if none found.

type EntryMultiError

type EntryMultiError []error

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

func (EntryMultiError) AllErrors

func (m EntryMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (EntryMultiError) Error

func (m EntryMultiError) Error() string

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

type EntryServiceClient

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

EntryServiceClient is the client API for EntryService 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 EntryServiceServer

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

EntryServiceServer is the server API for EntryService service. All implementations should embed UnimplementedEntryServiceServer for forward compatibility

type EntryValidationError

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

EntryValidationError is the validation error returned by Entry.Validate if the designated constraints aren't met.

func (EntryValidationError) Cause

func (e EntryValidationError) Cause() error

Cause function returns cause value.

func (EntryValidationError) Error

func (e EntryValidationError) Error() string

Error satisfies the builtin error interface

func (EntryValidationError) ErrorName

func (e EntryValidationError) ErrorName() string

ErrorName returns error name.

func (EntryValidationError) Field

func (e EntryValidationError) Field() string

Field function returns field value.

func (EntryValidationError) Key

func (e EntryValidationError) Key() bool

Key function returns key value.

func (EntryValidationError) Reason

func (e EntryValidationError) Reason() string

Reason function returns reason value.

type Entry_Scope

type Entry_Scope int32
const (
	Entry_ALL     Entry_Scope = 0
	Entry_PARTIAL Entry_Scope = 1
)

func (Entry_Scope) Descriptor

func (Entry_Scope) Enum

func (x Entry_Scope) Enum() *Entry_Scope

func (Entry_Scope) EnumDescriptor deprecated

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

Deprecated: Use Entry_Scope.Descriptor instead.

func (Entry_Scope) Number

func (x Entry_Scope) Number() protoreflect.EnumNumber

func (Entry_Scope) String

func (x Entry_Scope) String() string

func (Entry_Scope) Type

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 []*Entry `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() []*Entry

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 UnimplementedEntryServiceServer

type UnimplementedEntryServiceServer struct {
}

UnimplementedEntryServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedEntryServiceServer) Create

func (UnimplementedEntryServiceServer) Delete

func (UnimplementedEntryServiceServer) List

func (UnimplementedEntryServiceServer) Update

type UnsafeEntryServiceServer

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

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

type UpdateRequest

type UpdateRequest struct {
	Payload    *Entry                 `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() *Entry

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