solaris

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Service_CreateLog_FullMethodName     = "/solaris.v1.Service/CreateLog"
	Service_UpdateLog_FullMethodName     = "/solaris.v1.Service/UpdateLog"
	Service_QueryLogs_FullMethodName     = "/solaris.v1.Service/QueryLogs"
	Service_DeleteLogs_FullMethodName    = "/solaris.v1.Service/DeleteLogs"
	Service_AppendRecords_FullMethodName = "/solaris.v1.Service/AppendRecords"
	Service_QueryRecords_FullMethodName  = "/solaris.v1.Service/QueryRecords"
	Service_CountRecords_FullMethodName  = "/solaris.v1.Service/CountRecords"
)

Variables

View Source
var File_solaris_proto protoreflect.FileDescriptor
View Source
var Service_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "solaris.v1.Service",
	HandlerType: (*ServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateLog",
			Handler:    _Service_CreateLog_Handler,
		},
		{
			MethodName: "UpdateLog",
			Handler:    _Service_UpdateLog_Handler,
		},
		{
			MethodName: "QueryLogs",
			Handler:    _Service_QueryLogs_Handler,
		},
		{
			MethodName: "DeleteLogs",
			Handler:    _Service_DeleteLogs_Handler,
		},
		{
			MethodName: "AppendRecords",
			Handler:    _Service_AppendRecords_Handler,
		},
		{
			MethodName: "QueryRecords",
			Handler:    _Service_QueryRecords_Handler,
		},
		{
			MethodName: "CountRecords",
			Handler:    _Service_CountRecords_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "solaris.proto",
}

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

Functions

func RegisterServiceServer

func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)

Types

type AppendRecordsRequest

type AppendRecordsRequest struct {

	// logID is where the new records will be added
	LogID string `protobuf:"bytes,1,opt,name=logID,proto3" json:"logID,omitempty"`
	// records the list of records to be added
	Records []*Record `protobuf:"bytes,2,rep,name=records,proto3" json:"records,omitempty"`
	// contains filtered or unexported fields
}

AppendRecordsRequest describes the parameters for AppendRecords() call

func (*AppendRecordsRequest) Descriptor deprecated

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

Deprecated: Use AppendRecordsRequest.ProtoReflect.Descriptor instead.

func (*AppendRecordsRequest) GetLogID

func (x *AppendRecordsRequest) GetLogID() string

func (*AppendRecordsRequest) GetRecords

func (x *AppendRecordsRequest) GetRecords() []*Record

func (*AppendRecordsRequest) ProtoMessage

func (*AppendRecordsRequest) ProtoMessage()

func (*AppendRecordsRequest) ProtoReflect

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

func (*AppendRecordsRequest) Reset

func (x *AppendRecordsRequest) Reset()

func (*AppendRecordsRequest) String

func (x *AppendRecordsRequest) String() string

type AppendRecordsResult

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

AppendRecordsResult contains the number or records added to the log

func (*AppendRecordsResult) Descriptor deprecated

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

Deprecated: Use AppendRecordsResult.ProtoReflect.Descriptor instead.

func (*AppendRecordsResult) GetAdded

func (x *AppendRecordsResult) GetAdded() int64

func (*AppendRecordsResult) ProtoMessage

func (*AppendRecordsResult) ProtoMessage()

func (*AppendRecordsResult) ProtoReflect

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

func (*AppendRecordsResult) Reset

func (x *AppendRecordsResult) Reset()

func (*AppendRecordsResult) String

func (x *AppendRecordsResult) String() string

type CountResult

type CountResult struct {

	// total contains the requested number
	Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
	// contains filtered or unexported fields
}

CountResult returns a counted number of an operation

func (*CountResult) Descriptor deprecated

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

Deprecated: Use CountResult.ProtoReflect.Descriptor instead.

func (*CountResult) GetTotal

func (x *CountResult) GetTotal() int64

func (*CountResult) ProtoMessage

func (*CountResult) ProtoMessage()

func (*CountResult) ProtoReflect

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

func (*CountResult) Reset

func (x *CountResult) Reset()

func (*CountResult) String

func (x *CountResult) String() string

type DeleteLogsRequest

type DeleteLogsRequest struct {
	Condition string `protobuf:"bytes,1,opt,name=condition,proto3" json:"condition,omitempty"`
	// contains filtered or unexported fields
}

DeleteLogsRequest specifies the condition for the deleted logs

func (*DeleteLogsRequest) Descriptor deprecated

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

Deprecated: Use DeleteLogsRequest.ProtoReflect.Descriptor instead.

func (*DeleteLogsRequest) GetCondition

func (x *DeleteLogsRequest) GetCondition() string

func (*DeleteLogsRequest) ProtoMessage

func (*DeleteLogsRequest) ProtoMessage()

func (*DeleteLogsRequest) ProtoReflect

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

func (*DeleteLogsRequest) Reset

func (x *DeleteLogsRequest) Reset()

func (*DeleteLogsRequest) String

func (x *DeleteLogsRequest) String() string

type DeleteLogsResult added in v0.8.0

type DeleteLogsResult struct {
	DeletedIDs []string `protobuf:"bytes,1,rep,name=deletedIDs,proto3" json:"deletedIDs,omitempty"`
	// contains filtered or unexported fields
}

DeleteLogsResult describes the response for DeleteLogsRequest

func (*DeleteLogsResult) Descriptor deprecated added in v0.8.0

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

Deprecated: Use DeleteLogsResult.ProtoReflect.Descriptor instead.

func (*DeleteLogsResult) GetDeletedIDs added in v0.8.0

func (x *DeleteLogsResult) GetDeletedIDs() []string

func (*DeleteLogsResult) ProtoMessage added in v0.8.0

func (*DeleteLogsResult) ProtoMessage()

func (*DeleteLogsResult) ProtoReflect added in v0.8.0

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

func (*DeleteLogsResult) Reset added in v0.8.0

func (x *DeleteLogsResult) Reset()

func (*DeleteLogsResult) String added in v0.8.0

func (x *DeleteLogsResult) String() string

type Log

type Log struct {

	// id of the log. It is ULID, so every log has a globaly unique ID
	ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	// tags is a map of tags and their values associated with the log
	Tags map[string]string `` /* 149-byte string literal not displayed */
	// createdAt is the timestamp when the log was created
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
	// updatedAt is the timestamp when the log was updated (new records added or tags are applied)
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"`
	// records is the number of records in the log
	Records int64 `protobuf:"varint,5,opt,name=records,proto3" json:"records,omitempty"`
	// contains filtered or unexported fields
}

Log describes a log in the database. Logs are distinguished by their IDs only

func (*Log) Descriptor deprecated

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

Deprecated: Use Log.ProtoReflect.Descriptor instead.

func (*Log) GetCreatedAt

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

func (*Log) GetID

func (x *Log) GetID() string

func (*Log) GetRecords

func (x *Log) GetRecords() int64

func (*Log) GetTags

func (x *Log) GetTags() map[string]string

func (*Log) GetUpdatedAt

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

func (*Log) ProtoMessage

func (*Log) ProtoMessage()

func (*Log) ProtoReflect

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

func (*Log) Reset

func (x *Log) Reset()

func (*Log) String

func (x *Log) String() string

type QueryLogsRequest

type QueryLogsRequest struct {

	// condition describes the log filter condition
	Condition string `protobuf:"bytes,1,opt,name=condition,proto3" json:"condition,omitempty"`
	// pageID is provided for paginated results
	PageID string `protobuf:"bytes,2,opt,name=pageID,proto3" json:"pageID,omitempty"`
	// limit contains tha maximum number of Log objects in the result
	Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

QueryLogsRequest allows to read multiple Log objects per one request

func (*QueryLogsRequest) Descriptor deprecated

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

Deprecated: Use QueryLogsRequest.ProtoReflect.Descriptor instead.

func (*QueryLogsRequest) GetCondition

func (x *QueryLogsRequest) GetCondition() string

func (*QueryLogsRequest) GetLimit

func (x *QueryLogsRequest) GetLimit() int64

func (*QueryLogsRequest) GetPageID

func (x *QueryLogsRequest) GetPageID() string

func (*QueryLogsRequest) ProtoMessage

func (*QueryLogsRequest) ProtoMessage()

func (*QueryLogsRequest) ProtoReflect

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

func (*QueryLogsRequest) Reset

func (x *QueryLogsRequest) Reset()

func (*QueryLogsRequest) String

func (x *QueryLogsRequest) String() string

type QueryLogsResult

type QueryLogsResult struct {

	// logs is the list of Log objects in the result
	Logs []*Log `protobuf:"bytes,1,rep,name=logs,proto3" json:"logs,omitempty"`
	// nextPageID contains the pageID for reading next portion of the records if any
	NextPageID string `protobuf:"bytes,2,opt,name=nextPageID,proto3" json:"nextPageID,omitempty"`
	// total is the number of records matched to the result
	Total int64 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"`
	// contains filtered or unexported fields
}

QueryLogsResult describes the response for QueryLogsRequest

func (*QueryLogsResult) Descriptor deprecated

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

Deprecated: Use QueryLogsResult.ProtoReflect.Descriptor instead.

func (*QueryLogsResult) GetLogs

func (x *QueryLogsResult) GetLogs() []*Log

func (*QueryLogsResult) GetNextPageID

func (x *QueryLogsResult) GetNextPageID() string

func (*QueryLogsResult) GetTotal

func (x *QueryLogsResult) GetTotal() int64

func (*QueryLogsResult) ProtoMessage

func (*QueryLogsResult) ProtoMessage()

func (*QueryLogsResult) ProtoReflect

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

func (*QueryLogsResult) Reset

func (x *QueryLogsResult) Reset()

func (*QueryLogsResult) String

func (x *QueryLogsResult) String() string

type QueryRecordsRequest

type QueryRecordsRequest struct {

	// logsCondition allows to specify the filter condition for selecting logs.
	LogsCondition string `protobuf:"bytes,1,opt,name=logsCondition,proto3" json:"logsCondition,omitempty"`
	// condition allows to specify the filter for the records.
	Condition string `protobuf:"bytes,2,opt,name=condition,proto3" json:"condition,omitempty"`
	// logIDs allows to specify the list of logs explicitly. If it is provided, then the logsCondition will be ignored.
	LogIDs []string `protobuf:"bytes,3,rep,name=logIDs,proto3" json:"logIDs,omitempty"`
	// descending specifies that the result should be sorted in the record ID descending order.
	Descending bool `protobuf:"varint,4,opt,name=descending,proto3" json:"descending,omitempty"`
	// startRecordID defines the first record ID the result set may start from. In case of ascending order, the
	// result will contain records with IDs are equal or GREATER the startRecordID. If the descending order
	// is true, the result will contain records with IDs are equal or LOWER the startRecordID.
	// If the startRecordID is empty the result will start from either first or latest record in the log, depending
	// on the descending flag value.
	StartRecordID string `protobuf:"bytes,5,opt,name=startRecordID,proto3" json:"startRecordID,omitempty"`
	// limit contains the number of records to be returned
	Limit int64 `protobuf:"varint,6,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

QueryRecordsRequest contains arguments for requesting Log(s) records

func (*QueryRecordsRequest) Descriptor deprecated

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

Deprecated: Use QueryRecordsRequest.ProtoReflect.Descriptor instead.

func (*QueryRecordsRequest) GetCondition

func (x *QueryRecordsRequest) GetCondition() string

func (*QueryRecordsRequest) GetDescending

func (x *QueryRecordsRequest) GetDescending() bool

func (*QueryRecordsRequest) GetLimit

func (x *QueryRecordsRequest) GetLimit() int64

func (*QueryRecordsRequest) GetLogIDs

func (x *QueryRecordsRequest) GetLogIDs() []string

func (*QueryRecordsRequest) GetLogsCondition

func (x *QueryRecordsRequest) GetLogsCondition() string

func (*QueryRecordsRequest) GetStartRecordID

func (x *QueryRecordsRequest) GetStartRecordID() string

func (*QueryRecordsRequest) ProtoMessage

func (*QueryRecordsRequest) ProtoMessage()

func (*QueryRecordsRequest) ProtoReflect

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

func (*QueryRecordsRequest) Reset

func (x *QueryRecordsRequest) Reset()

func (*QueryRecordsRequest) String

func (x *QueryRecordsRequest) String() string

type QueryRecordsResult

type QueryRecordsResult struct {

	// records is the list of records matched for the request
	Records []*Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"`
	// nextPageID contains the next page ID for retrieving the next portion of records
	NextPageID string `protobuf:"bytes,2,opt,name=nextPageID,proto3" json:"nextPageID,omitempty"`
	// contains filtered or unexported fields
}

QueryRecordsResult describes the result for the records request

func (*QueryRecordsResult) Descriptor deprecated

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

Deprecated: Use QueryRecordsResult.ProtoReflect.Descriptor instead.

func (*QueryRecordsResult) GetNextPageID

func (x *QueryRecordsResult) GetNextPageID() string

func (*QueryRecordsResult) GetRecords

func (x *QueryRecordsResult) GetRecords() []*Record

func (*QueryRecordsResult) ProtoMessage

func (*QueryRecordsResult) ProtoMessage()

func (*QueryRecordsResult) ProtoReflect

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

func (*QueryRecordsResult) Reset

func (x *QueryRecordsResult) Reset()

func (*QueryRecordsResult) String

func (x *QueryRecordsResult) String() string

type Record

type Record struct {

	// id is the record unique identifier. A record ID is ULID, so it is soreted and globaly unique.
	ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	// logID is the log identifier the record is associated with. In a bunch result the field may be empty,
	// this case the logID is same as for the previous record in the batch
	LogID string `protobuf:"bytes,2,opt,name=logID,proto3" json:"logID,omitempty"`
	// createdAt the timestamp when the record was added to the DB
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
	// payload is the record data
	Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

Record represents one record of a log

func (*Record) Descriptor deprecated

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

Deprecated: Use Record.ProtoReflect.Descriptor instead.

func (*Record) GetCreatedAt

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

func (*Record) GetID

func (x *Record) GetID() string

func (*Record) GetLogID

func (x *Record) GetLogID() string

func (*Record) GetPayload

func (x *Record) GetPayload() []byte

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) ProtoReflect

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

func (*Record) Reset

func (x *Record) Reset()

func (*Record) String

func (x *Record) String() string

type ServiceClient

type ServiceClient interface {
	// CreateLog creates then new log
	CreateLog(ctx context.Context, in *Log, opts ...grpc.CallOption) (*Log, error)
	// UpdateLog changes the log settings (tags)
	UpdateLog(ctx context.Context, in *Log, opts ...grpc.CallOption) (*Log, error)
	// QueryLogs requests list of logs by the query request ordered by the log IDs ascending order
	QueryLogs(ctx context.Context, in *QueryLogsRequest, opts ...grpc.CallOption) (*QueryLogsResult, error)
	// DeleteLogs removes one or more logs
	DeleteLogs(ctx context.Context, in *DeleteLogsRequest, opts ...grpc.CallOption) (*DeleteLogsResult, error)
	// AppendRecords appends a bunch of records to the log
	AppendRecords(ctx context.Context, in *AppendRecordsRequest, opts ...grpc.CallOption) (*AppendRecordsResult, error)
	// QueryRecords read records from one or many logs, merging them together into the result set
	// sorted in ascending or descending order by the records IDs (timestamps)
	QueryRecords(ctx context.Context, in *QueryRecordsRequest, opts ...grpc.CallOption) (*QueryRecordsResult, error)
	// CountRecords allows to count the number of records that matches QueryRecordsRequest
	CountRecords(ctx context.Context, in *QueryRecordsRequest, opts ...grpc.CallOption) (*CountResult, error)
}

ServiceClient is the client API for Service 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 NewServiceClient

func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient

type ServiceServer

type ServiceServer interface {
	// CreateLog creates then new log
	CreateLog(context.Context, *Log) (*Log, error)
	// UpdateLog changes the log settings (tags)
	UpdateLog(context.Context, *Log) (*Log, error)
	// QueryLogs requests list of logs by the query request ordered by the log IDs ascending order
	QueryLogs(context.Context, *QueryLogsRequest) (*QueryLogsResult, error)
	// DeleteLogs removes one or more logs
	DeleteLogs(context.Context, *DeleteLogsRequest) (*DeleteLogsResult, error)
	// AppendRecords appends a bunch of records to the log
	AppendRecords(context.Context, *AppendRecordsRequest) (*AppendRecordsResult, error)
	// QueryRecords read records from one or many logs, merging them together into the result set
	// sorted in ascending or descending order by the records IDs (timestamps)
	QueryRecords(context.Context, *QueryRecordsRequest) (*QueryRecordsResult, error)
	// CountRecords allows to count the number of records that matches QueryRecordsRequest
	CountRecords(context.Context, *QueryRecordsRequest) (*CountResult, error)
	// contains filtered or unexported methods
}

ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedServiceServer) AppendRecords

func (UnimplementedServiceServer) CountRecords

func (UnimplementedServiceServer) CreateLog

func (UnimplementedServiceServer) DeleteLogs

func (UnimplementedServiceServer) QueryLogs

func (UnimplementedServiceServer) QueryRecords

func (UnimplementedServiceServer) UpdateLog

type UnsafeServiceServer

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

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

Jump to

Keyboard shortcuts

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