grpc_log

package
v0.0.0-...-e0aea17 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENTITY_USER      = "USER"
	ENTITY_CHECKLIST = "CHECKLIST"

	ACTION_CREATE   = "CREATE"
	ACTION_UPDATE   = "UPDATE"
	ACTION_GET      = "GET"
	ACTION_DELETE   = "DELETE"
	ACTION_REGISTER = "REGISTER"
	ACTION_LOGIN    = "LOGIN"
)

Variables

View Source
var (
	LogRequest_Actions_name = map[int32]string{
		0: "REGISTER",
		1: "LOGIN",
		2: "CREATE",
		3: "UPDATE",
		4: "GET",
		5: "DELETE",
	}
	LogRequest_Actions_value = map[string]int32{
		"REGISTER": 0,
		"LOGIN":    1,
		"CREATE":   2,
		"UPDATE":   3,
		"GET":      4,
		"DELETE":   5,
	}
)

Enum value maps for LogRequest_Actions.

View Source
var (
	LogRequest_Entities_name = map[int32]string{
		0: "USER",
		1: "CHECKLIST",
	}
	LogRequest_Entities_value = map[string]int32{
		"USER":      0,
		"CHECKLIST": 1,
	}
)

Enum value maps for LogRequest_Entities.

View Source
var File_pkg_domain_grpc_log_proto protoreflect.FileDescriptor
View Source
var GrpcLogService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc_log.GrpcLogService",
	HandlerType: (*GrpcLogServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Log",
			Handler:    _GrpcLogService_Log_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pkg/domain/grpc_log.proto",
}

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

Functions

func RegisterGrpcLogServiceServer

func RegisterGrpcLogServiceServer(s grpc.ServiceRegistrar, srv GrpcLogServiceServer)

Types

type GrpcLogServiceClient

type GrpcLogServiceClient interface {
	Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*Response, error)
}

GrpcLogServiceClient is the client API for GrpcLogService 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 GrpcLogServiceServer

type GrpcLogServiceServer interface {
	Log(context.Context, *LogRequest) (*Response, error)
	// contains filtered or unexported methods
}

GrpcLogServiceServer is the server API for GrpcLogService service. All implementations must embed UnimplementedGrpcLogServiceServer for forward compatibility

type LogItem

type LogItem struct {
	Entity    string    `bson:"entity"`
	Action    string    `bson:"action"`
	EntityID  int64     `bson:"entity_id"`
	Timestamp time.Time `bson:"timestamp"`
}

type LogRequest

type LogRequest struct {
	LogMsgId  int64                  `protobuf:"varint,1,opt,name=log_msg_id,json=logMsgId,proto3" json:"log_msg_id,omitempty"`
	Action    LogRequest_Actions     `protobuf:"varint,2,opt,name=action,proto3,enum=grpc_log.LogRequest_Actions" json:"action,omitempty"`
	Entity    LogRequest_Entities    `protobuf:"varint,3,opt,name=entity,proto3,enum=grpc_log.LogRequest_Entities" json:"entity,omitempty"`
	EntityId  int64                  `protobuf:"varint,4,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"`
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*LogRequest) Descriptor deprecated

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

Deprecated: Use LogRequest.ProtoReflect.Descriptor instead.

func (*LogRequest) GetAction

func (x *LogRequest) GetAction() LogRequest_Actions

func (*LogRequest) GetEntity

func (x *LogRequest) GetEntity() LogRequest_Entities

func (*LogRequest) GetEntityId

func (x *LogRequest) GetEntityId() int64

func (*LogRequest) GetLogMsgId

func (x *LogRequest) GetLogMsgId() int64

func (*LogRequest) GetTimestamp

func (x *LogRequest) GetTimestamp() *timestamppb.Timestamp

func (*LogRequest) ProtoMessage

func (*LogRequest) ProtoMessage()

func (*LogRequest) ProtoReflect

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

func (*LogRequest) Reset

func (x *LogRequest) Reset()

func (*LogRequest) String

func (x *LogRequest) String() string

type LogRequest_Actions

type LogRequest_Actions int32
const (
	LogRequest_REGISTER LogRequest_Actions = 0
	LogRequest_LOGIN    LogRequest_Actions = 1
	LogRequest_CREATE   LogRequest_Actions = 2
	LogRequest_UPDATE   LogRequest_Actions = 3
	LogRequest_GET      LogRequest_Actions = 4
	LogRequest_DELETE   LogRequest_Actions = 5
)

func ToPbAction

func ToPbAction(action string) (LogRequest_Actions, error)

func (LogRequest_Actions) Descriptor

func (LogRequest_Actions) Enum

func (LogRequest_Actions) EnumDescriptor deprecated

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

Deprecated: Use LogRequest_Actions.Descriptor instead.

func (LogRequest_Actions) Number

func (LogRequest_Actions) String

func (x LogRequest_Actions) String() string

func (LogRequest_Actions) Type

type LogRequest_Entities

type LogRequest_Entities int32
const (
	LogRequest_USER      LogRequest_Entities = 0
	LogRequest_CHECKLIST LogRequest_Entities = 1
)

func ToPbEntity

func ToPbEntity(entity string) (LogRequest_Entities, error)

func (LogRequest_Entities) Descriptor

func (LogRequest_Entities) Enum

func (LogRequest_Entities) EnumDescriptor deprecated

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

Deprecated: Use LogRequest_Entities.Descriptor instead.

func (LogRequest_Entities) Number

func (LogRequest_Entities) String

func (x LogRequest_Entities) String() string

func (LogRequest_Entities) Type

type Response

type Response struct {
	LogMsgId int64 `protobuf:"varint,1,opt,name=log_msg_id,json=logMsgId,proto3" json:"log_msg_id,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetLogMsgId

func (x *Response) GetLogMsgId() int64

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type UnimplementedGrpcLogServiceServer

type UnimplementedGrpcLogServiceServer struct {
}

UnimplementedGrpcLogServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedGrpcLogServiceServer) Log

type UnsafeGrpcLogServiceServer

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

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

Jump to

Keyboard shortcuts

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