logs_service

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RequestStatus_name = map[int32]string{
		0: "CONFIRMED",
		1: "ERROR",
	}
	RequestStatus_value = map[string]int32{
		"CONFIRMED": 0,
		"ERROR":     1,
	}
)

Enum value maps for RequestStatus.

View Source
var File_cc_service_proto protoreflect.FileDescriptor
View Source
var LogClient_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "codectrl.logs_service.LogClient",
	HandlerType: (*LogClientServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SendLog",
			Handler:    _LogClient_SendLog_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SendLogs",
			Handler:       _LogClient_SendLogs_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "cc_service.proto",
}

LogClient_ServiceDesc is the grpc.ServiceDesc for LogClient 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 LogServer_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "codectrl.logs_service.LogServer",
	HandlerType: (*LogServerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetLog",
			Handler:    _LogServer_GetLog_Handler,
		},
		{
			MethodName: "GetServerDetails",
			Handler:    _LogServer_GetServerDetails_Handler,
		},
		{
			MethodName: "RegisterClient",
			Handler:    _LogServer_RegisterClient_Handler,
		},
		{
			MethodName: "RegisterExistingClient",
			Handler:    _LogServer_RegisterExistingClient_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetLogs",
			Handler:       _LogServer_GetLogs_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "cc_service.proto",
}

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

Functions

func RegisterLogClientServer

func RegisterLogClientServer(s grpc.ServiceRegistrar, srv LogClientServer)

func RegisterLogServerServer

func RegisterLogServerServer(s grpc.ServiceRegistrar, srv LogServerServer)

Types

type Connection

type Connection struct {
	Uuid  string              `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Token *auth_service.Token `protobuf:"bytes,2,opt,name=token,proto3,oneof" json:"token,omitempty"`
	// contains filtered or unexported fields
}

Describes the connection between the interface and a given server. Each client is supplied with a uuid that is saved to disk or to localStorage. The server uses this information to determine which logs should be sent to each client and to skip duplicate identified by the `uuid` of the log.

func (*Connection) Descriptor deprecated

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

Deprecated: Use Connection.ProtoReflect.Descriptor instead.

func (*Connection) GetToken

func (x *Connection) GetToken() *auth_service.Token

func (*Connection) GetUuid

func (x *Connection) GetUuid() string

func (*Connection) ProtoMessage

func (*Connection) ProtoMessage()

func (*Connection) ProtoReflect

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

func (*Connection) Reset

func (x *Connection) Reset()

func (*Connection) String

func (x *Connection) String() string

type LogClientClient

type LogClientClient interface {
	// Sends a single log. Should only be used in cases where log batching is not
	// possible or not determinable.
	SendLog(ctx context.Context, in *log.Log, opts ...grpc.CallOption) (*RequestResult, error)
	// Sends a stream of logs. Should generally be preferred over `SendLog` as it
	// allows for batch sending of `Log`s and _should_ be more efficient on
	// resources.
	SendLogs(ctx context.Context, opts ...grpc.CallOption) (LogClient_SendLogsClient, error)
}

LogClientClient is the client API for LogClient 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 NewLogClientClient

func NewLogClientClient(cc grpc.ClientConnInterface) LogClientClient

type LogClientServer

type LogClientServer interface {
	// Sends a single log. Should only be used in cases where log batching is not
	// possible or not determinable.
	SendLog(context.Context, *log.Log) (*RequestResult, error)
	// Sends a stream of logs. Should generally be preferred over `SendLog` as it
	// allows for batch sending of `Log`s and _should_ be more efficient on
	// resources.
	SendLogs(LogClient_SendLogsServer) error
	// contains filtered or unexported methods
}

LogClientServer is the server API for LogClient service. All implementations must embed UnimplementedLogClientServer for forward compatibility

type LogClient_SendLogsClient

type LogClient_SendLogsClient interface {
	Send(*log.Log) error
	CloseAndRecv() (*RequestResult, error)
	grpc.ClientStream
}

type LogClient_SendLogsServer

type LogClient_SendLogsServer interface {
	SendAndClose(*RequestResult) error
	Recv() (*log.Log, error)
	grpc.ServerStream
}

type LogServerClient

type LogServerClient interface {
	// Gets the latest log from the server, generally not used but is here for
	// compatibiliy's sake in the case where a front-end cannot use a stream.
	GetLog(ctx context.Context, in *Connection, opts ...grpc.CallOption) (*log.Log, error)
	// Gets a stream of the available logs, this should be preferred over
	// `GetLog` when possible.
	GetLogs(ctx context.Context, in *Connection, opts ...grpc.CallOption) (LogServer_GetLogsClient, error)
	// Gets the current details about the server.
	GetServerDetails(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ServerDetails, error)
	// Registers a new front-end connection to a server instance and returns the
	// `Connection` message with a `uuid`.
	RegisterClient(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Connection, error)
	// Registers an already pre-existing connection to a server instance using an
	// already generated `uuid` supplied in the `Connection`. Servers should
	// verify that the supplied `uuid` is, in fact, a valid hyphenated v4 UUID.
	// Returns a boolean whether or not the registration was succesful.
	RegisterExistingClient(ctx context.Context, in *Connection, opts ...grpc.CallOption) (*RequestResult, error)
}

LogServerClient is the client API for LogServer 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 NewLogServerClient

func NewLogServerClient(cc grpc.ClientConnInterface) LogServerClient

type LogServerServer

type LogServerServer interface {
	// Gets the latest log from the server, generally not used but is here for
	// compatibiliy's sake in the case where a front-end cannot use a stream.
	GetLog(context.Context, *Connection) (*log.Log, error)
	// Gets a stream of the available logs, this should be preferred over
	// `GetLog` when possible.
	GetLogs(*Connection, LogServer_GetLogsServer) error
	// Gets the current details about the server.
	GetServerDetails(context.Context, *emptypb.Empty) (*ServerDetails, error)
	// Registers a new front-end connection to a server instance and returns the
	// `Connection` message with a `uuid`.
	RegisterClient(context.Context, *emptypb.Empty) (*Connection, error)
	// Registers an already pre-existing connection to a server instance using an
	// already generated `uuid` supplied in the `Connection`. Servers should
	// verify that the supplied `uuid` is, in fact, a valid hyphenated v4 UUID.
	// Returns a boolean whether or not the registration was succesful.
	RegisterExistingClient(context.Context, *Connection) (*RequestResult, error)
	// contains filtered or unexported methods
}

LogServerServer is the server API for LogServer service. All implementations must embed UnimplementedLogServerServer for forward compatibility

type LogServer_GetLogsClient

type LogServer_GetLogsClient interface {
	Recv() (*log.Log, error)
	grpc.ClientStream
}

type LogServer_GetLogsServer

type LogServer_GetLogsServer interface {
	Send(*log.Log) error
	grpc.ServerStream
}

type RequestResult

type RequestResult struct {
	Message    string                                   `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	Status     RequestStatus                            `protobuf:"varint,2,opt,name=status,proto3,enum=codectrl.logs_service.RequestStatus" json:"status,omitempty"`
	AuthStatus *auth_service.GenerateTokenRequestResult `protobuf:"bytes,3,opt,name=authStatus,proto3,oneof" json:"authStatus,omitempty"`
	// contains filtered or unexported fields
}

Returned by the procedures to describe the result of a request.

func (*RequestResult) Descriptor deprecated

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

Deprecated: Use RequestResult.ProtoReflect.Descriptor instead.

func (*RequestResult) GetAuthStatus

func (*RequestResult) GetMessage

func (x *RequestResult) GetMessage() string

func (*RequestResult) GetStatus

func (x *RequestResult) GetStatus() RequestStatus

func (*RequestResult) ProtoMessage

func (*RequestResult) ProtoMessage()

func (*RequestResult) ProtoReflect

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

func (*RequestResult) Reset

func (x *RequestResult) Reset()

func (*RequestResult) String

func (x *RequestResult) String() string

type RequestStatus

type RequestStatus int32

Status codes for whether or not a particular request has succeeded.

const (
	RequestStatus_CONFIRMED RequestStatus = 0
	RequestStatus_ERROR     RequestStatus = 1
)

func (RequestStatus) Descriptor

func (RequestStatus) Enum

func (x RequestStatus) Enum() *RequestStatus

func (RequestStatus) EnumDescriptor deprecated

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

Deprecated: Use RequestStatus.Descriptor instead.

func (RequestStatus) Number

func (RequestStatus) String

func (x RequestStatus) String() string

func (RequestStatus) Type

type ServerDetails

type ServerDetails struct {
	Host                   string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	Port                   uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`
	Uptime                 uint64 `protobuf:"varint,3,opt,name=uptime,proto3" json:"uptime,omitempty"`
	RequiresAuthentication bool   `protobuf:"varint,4,opt,name=requiresAuthentication,proto3" json:"requiresAuthentication,omitempty"`
	// contains filtered or unexported fields
}

Server details about the current gRPC server.

func (*ServerDetails) Descriptor deprecated

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

Deprecated: Use ServerDetails.ProtoReflect.Descriptor instead.

func (*ServerDetails) GetHost

func (x *ServerDetails) GetHost() string

func (*ServerDetails) GetPort

func (x *ServerDetails) GetPort() uint32

func (*ServerDetails) GetRequiresAuthentication

func (x *ServerDetails) GetRequiresAuthentication() bool

func (*ServerDetails) GetUptime

func (x *ServerDetails) GetUptime() uint64

func (*ServerDetails) ProtoMessage

func (*ServerDetails) ProtoMessage()

func (*ServerDetails) ProtoReflect

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

func (*ServerDetails) Reset

func (x *ServerDetails) Reset()

func (*ServerDetails) String

func (x *ServerDetails) String() string

type UnimplementedLogClientServer

type UnimplementedLogClientServer struct {
}

UnimplementedLogClientServer must be embedded to have forward compatible implementations.

func (UnimplementedLogClientServer) SendLog

func (UnimplementedLogClientServer) SendLogs

type UnimplementedLogServerServer

type UnimplementedLogServerServer struct {
}

UnimplementedLogServerServer must be embedded to have forward compatible implementations.

func (UnimplementedLogServerServer) GetLog

func (UnimplementedLogServerServer) GetLogs

func (UnimplementedLogServerServer) GetServerDetails

func (UnimplementedLogServerServer) RegisterClient

func (UnimplementedLogServerServer) RegisterExistingClient

type UnsafeLogClientServer

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

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

type UnsafeLogServerServer

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

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

Jump to

Keyboard shortcuts

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