event

package
v4.25.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Overview

Package event is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Event_List_FullMethodName = "/event.Event/List"
	Event_Show_FullMethodName = "/event.Event/Show"
)

Variables

View Source
var Event_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "event.Event",
	HandlerType: (*EventServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _Event_List_Handler,
		},
		{
			MethodName: "Show",
			Handler:    _Event_Show_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "event/event.proto",
}

Event_ServiceDesc is the grpc.ServiceDesc for Event 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_event_event_proto protoreflect.FileDescriptor

Functions

func RegisterEventHandler

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

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

func RegisterEventHandlerClient

func RegisterEventHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EventClient) error

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

func RegisterEventHandlerFromEndpoint

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

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

func RegisterEventHandlerServer

func RegisterEventHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EventServer) error

RegisterEventHandlerServer registers the http handlers for service Event to "mux". UnaryRPC :call EventServer 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 RegisterEventHandlerFromEndpoint instead.

func RegisterEventServer

func RegisterEventServer(s grpc.ServiceRegistrar, srv EventServer)

Types

type EventClient

type EventClient interface {
	// List 用户操作事件列表, 不包含 old, new
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
	// Show 查看事件详情, 包含 old, new
	Show(ctx context.Context, in *ShowRequest, opts ...grpc.CallOption) (*ShowResponse, error)
}

EventClient is the client API for Event 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 NewEventClient

func NewEventClient(cc grpc.ClientConnInterface) EventClient

type EventServer

type EventServer interface {
	// List 用户操作事件列表, 不包含 old, new
	List(context.Context, *ListRequest) (*ListResponse, error)
	// Show 查看事件详情, 包含 old, new
	Show(context.Context, *ShowRequest) (*ShowResponse, error)
	// contains filtered or unexported methods
}

EventServer is the server API for Event service. All implementations must embed UnimplementedEventServer for forward compatibility

type ListRequest

type ListRequest struct {
	Page       int64                 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	PageSize   int64                 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	ActionType types.EventActionType `protobuf:"varint,3,opt,name=action_type,json=actionType,proto3,enum=types.EventActionType" json:"action_type,omitempty"`
	// 模糊搜索 message 和 username
	Search string `protobuf:"bytes,4,opt,name=search,proto3" json:"search,omitempty"`
	// contains filtered or unexported fields
}

func (*ListRequest) Descriptor deprecated

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

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetActionType

func (x *ListRequest) GetActionType() types.EventActionType

func (*ListRequest) GetPage

func (x *ListRequest) GetPage() int64

func (*ListRequest) GetPageSize

func (x *ListRequest) GetPageSize() int64

func (*ListRequest) GetSearch

func (x *ListRequest) GetSearch() 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 {
	Page     int64               `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	PageSize int64               `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	Items    []*types.EventModel `protobuf:"bytes,3,rep,name=items,proto3" json:"items,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() []*types.EventModel

func (*ListResponse) GetPage

func (x *ListResponse) GetPage() int64

func (*ListResponse) GetPageSize

func (x *ListResponse) GetPageSize() 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 ShowRequest

type ShowRequest struct {
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*ShowRequest) Descriptor deprecated

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

Deprecated: Use ShowRequest.ProtoReflect.Descriptor instead.

func (*ShowRequest) GetId

func (x *ShowRequest) GetId() int64

func (*ShowRequest) ProtoMessage

func (*ShowRequest) ProtoMessage()

func (*ShowRequest) ProtoReflect

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

func (*ShowRequest) Reset

func (x *ShowRequest) Reset()

func (*ShowRequest) String

func (x *ShowRequest) String() string

func (*ShowRequest) Validate

func (m *ShowRequest) Validate() error

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

func (m *ShowRequest) ValidateAll() error

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

type ShowRequestMultiError

type ShowRequestMultiError []error

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

func (ShowRequestMultiError) AllErrors

func (m ShowRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ShowRequestMultiError) Error

func (m ShowRequestMultiError) Error() string

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

type ShowRequestValidationError

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

ShowRequestValidationError is the validation error returned by ShowRequest.Validate if the designated constraints aren't met.

func (ShowRequestValidationError) Cause

Cause function returns cause value.

func (ShowRequestValidationError) Error

Error satisfies the builtin error interface

func (ShowRequestValidationError) ErrorName

func (e ShowRequestValidationError) ErrorName() string

ErrorName returns error name.

func (ShowRequestValidationError) Field

Field function returns field value.

func (ShowRequestValidationError) Key

Key function returns key value.

func (ShowRequestValidationError) Reason

Reason function returns reason value.

type ShowResponse

type ShowResponse struct {
	Event *types.EventModel `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"`
	// contains filtered or unexported fields
}

func (*ShowResponse) Descriptor deprecated

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

Deprecated: Use ShowResponse.ProtoReflect.Descriptor instead.

func (*ShowResponse) GetEvent

func (x *ShowResponse) GetEvent() *types.EventModel

func (*ShowResponse) ProtoMessage

func (*ShowResponse) ProtoMessage()

func (*ShowResponse) ProtoReflect

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

func (*ShowResponse) Reset

func (x *ShowResponse) Reset()

func (*ShowResponse) String

func (x *ShowResponse) String() string

func (*ShowResponse) Validate

func (m *ShowResponse) Validate() error

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

func (m *ShowResponse) ValidateAll() error

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

type ShowResponseMultiError

type ShowResponseMultiError []error

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

func (ShowResponseMultiError) AllErrors

func (m ShowResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ShowResponseMultiError) Error

func (m ShowResponseMultiError) Error() string

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

type ShowResponseValidationError

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

ShowResponseValidationError is the validation error returned by ShowResponse.Validate if the designated constraints aren't met.

func (ShowResponseValidationError) Cause

Cause function returns cause value.

func (ShowResponseValidationError) Error

Error satisfies the builtin error interface

func (ShowResponseValidationError) ErrorName

func (e ShowResponseValidationError) ErrorName() string

ErrorName returns error name.

func (ShowResponseValidationError) Field

Field function returns field value.

func (ShowResponseValidationError) Key

Key function returns key value.

func (ShowResponseValidationError) Reason

Reason function returns reason value.

type UnimplementedEventServer

type UnimplementedEventServer struct {
}

UnimplementedEventServer must be embedded to have forward compatible implementations.

func (UnimplementedEventServer) List

func (UnimplementedEventServer) Show

type UnsafeEventServer

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

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

Jump to

Keyboard shortcuts

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