event

package
v0.0.0-...-51115e0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

Package event is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ActionType_name = map[int32]string{
		0: "Unknown",
		1: "Create",
		2: "Update",
		3: "Delete",
		4: "Upload",
		5: "Download",
	}
	ActionType_value = map[string]int32{
		"Unknown":  0,
		"Create":   1,
		"Update":   2,
		"Delete":   3,
		"Upload":   4,
		"Download": 5,
	}
)

Enum value maps for ActionType.

View Source
var Event_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Event",
	HandlerType: (*EventServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _Event_List_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 ActionType

type ActionType int32
const (
	ActionType_Unknown  ActionType = 0
	ActionType_Create   ActionType = 1
	ActionType_Update   ActionType = 2
	ActionType_Delete   ActionType = 3
	ActionType_Upload   ActionType = 4
	ActionType_Download ActionType = 5
)

func (ActionType) Descriptor

func (ActionType) Descriptor() protoreflect.EnumDescriptor

func (ActionType) Enum

func (x ActionType) Enum() *ActionType

func (ActionType) EnumDescriptor deprecated

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

Deprecated: Use ActionType.Descriptor instead.

func (ActionType) Number

func (x ActionType) Number() protoreflect.EnumNumber

func (ActionType) String

func (x ActionType) String() string

func (ActionType) Type

type EventClient

type EventClient interface {
	// List 用户操作事件列表
	List(ctx context.Context, in *EventListRequest, opts ...grpc.CallOption) (*EventListResponse, 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 EventListItem

type EventListItem struct {
	Id       int64      `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Action   ActionType `protobuf:"varint,2,opt,name=action,proto3,enum=ActionType" json:"action,omitempty"`
	Username string     `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
	Message  string     `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"`
	Old      string     `protobuf:"bytes,5,opt,name=old,proto3" json:"old,omitempty"`
	New      string     `protobuf:"bytes,6,opt,name=new,proto3" json:"new,omitempty"`
	EventAt  string     `protobuf:"bytes,7,opt,name=event_at,json=eventAt,proto3" json:"event_at,omitempty"`
	FileId   int64      `protobuf:"varint,8,opt,name=file_id,json=fileId,proto3" json:"file_id,omitempty"`
	// contains filtered or unexported fields
}

func (*EventListItem) Descriptor deprecated

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

Deprecated: Use EventListItem.ProtoReflect.Descriptor instead.

func (*EventListItem) GetAction

func (x *EventListItem) GetAction() ActionType

func (*EventListItem) GetEventAt

func (x *EventListItem) GetEventAt() string

func (*EventListItem) GetFileId

func (x *EventListItem) GetFileId() int64

func (*EventListItem) GetId

func (x *EventListItem) GetId() int64

func (*EventListItem) GetMessage

func (x *EventListItem) GetMessage() string

func (*EventListItem) GetNew

func (x *EventListItem) GetNew() string

func (*EventListItem) GetOld

func (x *EventListItem) GetOld() string

func (*EventListItem) GetUsername

func (x *EventListItem) GetUsername() string

func (*EventListItem) ProtoMessage

func (*EventListItem) ProtoMessage()

func (*EventListItem) ProtoReflect

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

func (*EventListItem) Reset

func (x *EventListItem) Reset()

func (*EventListItem) String

func (x *EventListItem) String() string

func (*EventListItem) Validate

func (m *EventListItem) Validate() error

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

func (m *EventListItem) ValidateAll() error

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

type EventListItemMultiError

type EventListItemMultiError []error

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

func (EventListItemMultiError) AllErrors

func (m EventListItemMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (EventListItemMultiError) Error

func (m EventListItemMultiError) Error() string

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

type EventListItemValidationError

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

EventListItemValidationError is the validation error returned by EventListItem.Validate if the designated constraints aren't met.

func (EventListItemValidationError) Cause

Cause function returns cause value.

func (EventListItemValidationError) Error

Error satisfies the builtin error interface

func (EventListItemValidationError) ErrorName

func (e EventListItemValidationError) ErrorName() string

ErrorName returns error name.

func (EventListItemValidationError) Field

Field function returns field value.

func (EventListItemValidationError) Key

Key function returns key value.

func (EventListItemValidationError) Reason

Reason function returns reason value.

type EventListRequest

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

func (*EventListRequest) Descriptor deprecated

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

Deprecated: Use EventListRequest.ProtoReflect.Descriptor instead.

func (*EventListRequest) GetPage

func (x *EventListRequest) GetPage() int64

func (*EventListRequest) GetPageSize

func (x *EventListRequest) GetPageSize() int64

func (*EventListRequest) ProtoMessage

func (*EventListRequest) ProtoMessage()

func (*EventListRequest) ProtoReflect

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

func (*EventListRequest) Reset

func (x *EventListRequest) Reset()

func (*EventListRequest) String

func (x *EventListRequest) String() string

func (*EventListRequest) Validate

func (m *EventListRequest) Validate() error

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

func (m *EventListRequest) ValidateAll() error

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

type EventListRequestMultiError

type EventListRequestMultiError []error

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

func (EventListRequestMultiError) AllErrors

func (m EventListRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (EventListRequestMultiError) Error

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

type EventListRequestValidationError

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

EventListRequestValidationError is the validation error returned by EventListRequest.Validate if the designated constraints aren't met.

func (EventListRequestValidationError) Cause

Cause function returns cause value.

func (EventListRequestValidationError) Error

Error satisfies the builtin error interface

func (EventListRequestValidationError) ErrorName

ErrorName returns error name.

func (EventListRequestValidationError) Field

Field function returns field value.

func (EventListRequestValidationError) Key

Key function returns key value.

func (EventListRequestValidationError) Reason

Reason function returns reason value.

type EventListResponse

type EventListResponse 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    []*EventListItem `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty"`
	Count    int64            `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

func (*EventListResponse) Descriptor deprecated

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

Deprecated: Use EventListResponse.ProtoReflect.Descriptor instead.

func (*EventListResponse) GetCount

func (x *EventListResponse) GetCount() int64

func (*EventListResponse) GetItems

func (x *EventListResponse) GetItems() []*EventListItem

func (*EventListResponse) GetPage

func (x *EventListResponse) GetPage() int64

func (*EventListResponse) GetPageSize

func (x *EventListResponse) GetPageSize() int64

func (*EventListResponse) ProtoMessage

func (*EventListResponse) ProtoMessage()

func (*EventListResponse) ProtoReflect

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

func (*EventListResponse) Reset

func (x *EventListResponse) Reset()

func (*EventListResponse) String

func (x *EventListResponse) String() string

func (*EventListResponse) Validate

func (m *EventListResponse) Validate() error

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

func (m *EventListResponse) ValidateAll() error

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

type EventListResponseMultiError

type EventListResponseMultiError []error

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

func (EventListResponseMultiError) AllErrors

func (m EventListResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (EventListResponseMultiError) Error

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

type EventListResponseValidationError

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

EventListResponseValidationError is the validation error returned by EventListResponse.Validate if the designated constraints aren't met.

func (EventListResponseValidationError) Cause

Cause function returns cause value.

func (EventListResponseValidationError) Error

Error satisfies the builtin error interface

func (EventListResponseValidationError) ErrorName

ErrorName returns error name.

func (EventListResponseValidationError) Field

Field function returns field value.

func (EventListResponseValidationError) Key

Key function returns key value.

func (EventListResponseValidationError) Reason

Reason function returns reason value.

type EventServer

type EventServer interface {
	// List 用户操作事件列表
	List(context.Context, *EventListRequest) (*EventListResponse, error)
	// contains filtered or unexported methods
}

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

type UnimplementedEventServer

type UnimplementedEventServer struct {
}

UnimplementedEventServer must be embedded to have forward compatible implementations.

func (UnimplementedEventServer) List

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