orisun

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Admin_CreateUser_FullMethodName          = "/orisun.Admin/CreateUser"
	Admin_DeleteUser_FullMethodName          = "/orisun.Admin/DeleteUser"
	Admin_ChangePassword_FullMethodName      = "/orisun.Admin/ChangePassword"
	Admin_ListUsers_FullMethodName           = "/orisun.Admin/ListUsers"
	Admin_ValidateCredentials_FullMethodName = "/orisun.Admin/ValidateCredentials"
	Admin_GetUserCount_FullMethodName        = "/orisun.Admin/GetUserCount"
	Admin_GetEventCount_FullMethodName       = "/orisun.Admin/GetEventCount"
	Admin_CreateIndex_FullMethodName         = "/orisun.Admin/CreateIndex"
	Admin_DropIndex_FullMethodName           = "/orisun.Admin/DropIndex"
)
View Source
const (
	EventStore_SaveEvents_FullMethodName               = "/orisun.EventStore/SaveEvents"
	EventStore_GetEvents_FullMethodName                = "/orisun.EventStore/GetEvents"
	EventStore_CatchUpSubscribeToEvents_FullMethodName = "/orisun.EventStore/CatchUpSubscribeToEvents"
	EventStore_Ping_FullMethodName                     = "/orisun.EventStore/Ping"
)
View Source
const (
	EventsSubjectName = "events"
)
View Source
const (
	StreamDoesNotExist = -1
)

Variables

View Source
var (
	ValueType_name = map[int32]string{
		0: "TEXT",
		1: "NUMERIC",
		2: "BOOLEAN",
		3: "TIMESTAMPTZ",
	}
	ValueType_value = map[string]int32{
		"TEXT":        0,
		"NUMERIC":     1,
		"BOOLEAN":     2,
		"TIMESTAMPTZ": 3,
	}
)

Enum value maps for ValueType.

View Source
var (
	ConditionCombinator_name = map[int32]string{
		0: "AND",
		1: "OR",
	}
	ConditionCombinator_value = map[string]int32{
		"AND": 0,
		"OR":  1,
	}
)

Enum value maps for ConditionCombinator.

View Source
var (
	Direction_name = map[int32]string{
		0: "ASC",
		1: "DESC",
	}
	Direction_value = map[string]int32{
		"ASC":  0,
		"DESC": 1,
	}
)

Enum value maps for Direction.

View Source
var Admin_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "orisun.Admin",
	HandlerType: (*AdminServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateUser",
			Handler:    _Admin_CreateUser_Handler,
		},
		{
			MethodName: "DeleteUser",
			Handler:    _Admin_DeleteUser_Handler,
		},
		{
			MethodName: "ChangePassword",
			Handler:    _Admin_ChangePassword_Handler,
		},
		{
			MethodName: "ListUsers",
			Handler:    _Admin_ListUsers_Handler,
		},
		{
			MethodName: "ValidateCredentials",
			Handler:    _Admin_ValidateCredentials_Handler,
		},
		{
			MethodName: "GetUserCount",
			Handler:    _Admin_GetUserCount_Handler,
		},
		{
			MethodName: "GetEventCount",
			Handler:    _Admin_GetEventCount_Handler,
		},
		{
			MethodName: "CreateIndex",
			Handler:    _Admin_CreateIndex_Handler,
		},
		{
			MethodName: "DropIndex",
			Handler:    _Admin_DropIndex_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "admin.proto",
}

Admin_ServiceDesc is the grpc.ServiceDesc for Admin 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 BuildTime = "unknown"

BuildTime is the time when the binary was built. This will be overridden during build by the -ldflags="-X 'orisun/orisun.BuildTime=<timestamp>'" flag.

View Source
var ErrQueueFull = errors.New("message handler queue full")
View Source
var EventStore_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "orisun.EventStore",
	HandlerType: (*EventStoreServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SaveEvents",
			Handler:    _EventStore_SaveEvents_Handler,
		},
		{
			MethodName: "GetEvents",
			Handler:    _EventStore_GetEvents_Handler,
		},
		{
			MethodName: "Ping",
			Handler:    _EventStore_Ping_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "CatchUpSubscribeToEvents",
			Handler:       _EventStore_CatchUpSubscribeToEvents_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "eventstore.proto",
}

EventStore_ServiceDesc is the grpc.ServiceDesc for EventStore 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_admin_proto protoreflect.FileDescriptor
View Source
var File_eventstore_proto protoreflect.FileDescriptor
View Source
var GitCommit = "unknown"

GitCommit is the git commit hash from which the binary was built. This will be overridden during build by the -ldflags="-X 'orisun/orisun.GitCommit=<hash>'" flag.

View Source
var Version = "dev"

Version is the current version of Orisun. This will be overridden during build by the -ldflags="-X 'orisun/orisun.Version=v1.2.3'" flag.

Functions

func GetBuildInfo

func GetBuildInfo() (string, string, string)

GetBuildInfo returns the version, build time, and git commit hash.

func GetEventJetstreamSubjectName

func GetEventJetstreamSubjectName(boundary string, position *Position) string

func GetEventNatsMessageId

func GetEventNatsMessageId(preparePosition int64, commitPosition int64) string

func GetEventsNatsJetstreamStreamStreamName

func GetEventsNatsJetstreamStreamStreamName(boundary string) string

func GetEventsStreamSubjectFilterForSubscription

func GetEventsStreamSubjectFilterForSubscription(boundary string, stream *string) string

func GetEventsSubjectName

func GetEventsSubjectName(boundary string) string

func GetVersion

func GetVersion() string

GetVersion returns the current version of Orisun.

func PollEventsFromDatabaseToNats

func PollEventsFromDatabaseToNats(
	ctx context.Context,
	js jetstream.JetStream,
	eventStore EventsRetriever,
	batchSize uint32,
	lastPosition *Position,
	boundary string,
	db EventPublishingTracker,
	schema string,
	logger logging.Logger,
) error

func RegisterAdminServer

func RegisterAdminServer(s grpc.ServiceRegistrar, srv AdminServer)

func RegisterEventStoreServer

func RegisterEventStoreServer(s grpc.ServiceRegistrar, srv EventStoreServer)

func StartEventPolling

func StartEventPolling(
	ctx context.Context,
	config c.AppConfig,
	lockProvider LockProvider,
	getEvents EventsRetriever,
	js jetstream.JetStream,
	eventPublishingTracker EventPublishingTracker,
	logger logging.Logger)

Types

type AdminClient

type AdminClient interface {
	// User Management
	CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error)
	DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error)
	ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error)
	ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error)
	// Authentication
	ValidateCredentials(ctx context.Context, in *ValidateCredentialsRequest, opts ...grpc.CallOption) (*ValidateCredentialsResponse, error)
	// Statistics
	GetUserCount(ctx context.Context, in *GetUserCountRequest, opts ...grpc.CallOption) (*GetUserCountResponse, error)
	GetEventCount(ctx context.Context, in *GetEventCountRequest, opts ...grpc.CallOption) (*GetEventCountResponse, error)
	// Index Management
	CreateIndex(ctx context.Context, in *CreateIndexRequest, opts ...grpc.CallOption) (*CreateIndexResponse, error)
	DropIndex(ctx context.Context, in *DropIndexRequest, opts ...grpc.CallOption) (*DropIndexResponse, error)
}

AdminClient is the client API for Admin 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.

Admin service provides user management and administrative operations

func NewAdminClient

func NewAdminClient(cc grpc.ClientConnInterface) AdminClient

type AdminServer

type AdminServer interface {
	// User Management
	CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
	DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error)
	ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error)
	ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error)
	// Authentication
	ValidateCredentials(context.Context, *ValidateCredentialsRequest) (*ValidateCredentialsResponse, error)
	// Statistics
	GetUserCount(context.Context, *GetUserCountRequest) (*GetUserCountResponse, error)
	GetEventCount(context.Context, *GetEventCountRequest) (*GetEventCountResponse, error)
	// Index Management
	CreateIndex(context.Context, *CreateIndexRequest) (*CreateIndexResponse, error)
	DropIndex(context.Context, *DropIndexRequest) (*DropIndexResponse, error)
	// contains filtered or unexported methods
}

AdminServer is the server API for Admin service. All implementations must embed UnimplementedAdminServer for forward compatibility.

Admin service provides user management and administrative operations

type AdminUser

type AdminUser struct {
	UserId    string                 `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Name      string                 `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Username  string                 `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
	Roles     []string               `protobuf:"bytes,4,rep,name=roles,proto3" json:"roles,omitempty"`
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

AdminUser represents a user in the system

func (*AdminUser) Descriptor deprecated

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

Deprecated: Use AdminUser.ProtoReflect.Descriptor instead.

func (*AdminUser) GetCreatedAt

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

func (*AdminUser) GetName

func (x *AdminUser) GetName() string

func (*AdminUser) GetRoles

func (x *AdminUser) GetRoles() []string

func (*AdminUser) GetUpdatedAt

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

func (*AdminUser) GetUserId

func (x *AdminUser) GetUserId() string

func (*AdminUser) GetUsername

func (x *AdminUser) GetUsername() string

func (*AdminUser) ProtoMessage

func (*AdminUser) ProtoMessage()

func (*AdminUser) ProtoReflect

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

func (*AdminUser) Reset

func (x *AdminUser) Reset()

func (*AdminUser) String

func (x *AdminUser) String() string

type CatchUpSubscribeToEventStoreRequest

type CatchUpSubscribeToEventStoreRequest struct {
	AfterPosition  *Position `protobuf:"bytes,1,opt,name=after_position,json=afterPosition,proto3" json:"after_position,omitempty"`
	Query          *Query    `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"`
	SubscriberName string    `protobuf:"bytes,3,opt,name=subscriber_name,json=subscriberName,proto3" json:"subscriber_name,omitempty"`
	Boundary       string    `protobuf:"bytes,4,opt,name=boundary,proto3" json:"boundary,omitempty"`
	// contains filtered or unexported fields
}

func (*CatchUpSubscribeToEventStoreRequest) Descriptor deprecated

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

Deprecated: Use CatchUpSubscribeToEventStoreRequest.ProtoReflect.Descriptor instead.

func (*CatchUpSubscribeToEventStoreRequest) GetAfterPosition

func (x *CatchUpSubscribeToEventStoreRequest) GetAfterPosition() *Position

func (*CatchUpSubscribeToEventStoreRequest) GetBoundary

func (*CatchUpSubscribeToEventStoreRequest) GetQuery

func (*CatchUpSubscribeToEventStoreRequest) GetSubscriberName

func (x *CatchUpSubscribeToEventStoreRequest) GetSubscriberName() string

func (*CatchUpSubscribeToEventStoreRequest) ProtoMessage

func (*CatchUpSubscribeToEventStoreRequest) ProtoMessage()

func (*CatchUpSubscribeToEventStoreRequest) ProtoReflect

func (*CatchUpSubscribeToEventStoreRequest) Reset

func (*CatchUpSubscribeToEventStoreRequest) String

type ChangePasswordRequest

type ChangePasswordRequest struct {
	UserId          string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	CurrentPassword string `protobuf:"bytes,2,opt,name=current_password,json=currentPassword,proto3" json:"current_password,omitempty"`
	NewPassword     string `protobuf:"bytes,3,opt,name=new_password,json=newPassword,proto3" json:"new_password,omitempty"`
	// contains filtered or unexported fields
}

ChangePasswordRequest changes a user's password

func (*ChangePasswordRequest) Descriptor deprecated

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

Deprecated: Use ChangePasswordRequest.ProtoReflect.Descriptor instead.

func (*ChangePasswordRequest) GetCurrentPassword

func (x *ChangePasswordRequest) GetCurrentPassword() string

func (*ChangePasswordRequest) GetNewPassword

func (x *ChangePasswordRequest) GetNewPassword() string

func (*ChangePasswordRequest) GetUserId

func (x *ChangePasswordRequest) GetUserId() string

func (*ChangePasswordRequest) ProtoMessage

func (*ChangePasswordRequest) ProtoMessage()

func (*ChangePasswordRequest) ProtoReflect

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

func (*ChangePasswordRequest) Reset

func (x *ChangePasswordRequest) Reset()

func (*ChangePasswordRequest) String

func (x *ChangePasswordRequest) String() string

type ChangePasswordResponse

type ChangePasswordResponse struct {
	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

ChangePasswordResponse indicates success

func (*ChangePasswordResponse) Descriptor deprecated

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

Deprecated: Use ChangePasswordResponse.ProtoReflect.Descriptor instead.

func (*ChangePasswordResponse) GetSuccess

func (x *ChangePasswordResponse) GetSuccess() bool

func (*ChangePasswordResponse) ProtoMessage

func (*ChangePasswordResponse) ProtoMessage()

func (*ChangePasswordResponse) ProtoReflect

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

func (*ChangePasswordResponse) Reset

func (x *ChangePasswordResponse) Reset()

func (*ChangePasswordResponse) String

func (x *ChangePasswordResponse) String() string

type ComparationResult

type ComparationResult int
const IsEqual ComparationResult = 0
const IsGreaterThan ComparationResult = 1
const IsLessThan ComparationResult = -1

func ComparePositions

func ComparePositions(p1, p2 *Position) ComparationResult

type ConditionCombinator added in v0.2.0

type ConditionCombinator int32
const (
	ConditionCombinator_AND ConditionCombinator = 0
	ConditionCombinator_OR  ConditionCombinator = 1
)

func (ConditionCombinator) Descriptor added in v0.2.0

func (ConditionCombinator) Enum added in v0.2.0

func (ConditionCombinator) EnumDescriptor deprecated added in v0.2.0

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

Deprecated: Use ConditionCombinator.Descriptor instead.

func (ConditionCombinator) Number added in v0.2.0

func (ConditionCombinator) String added in v0.2.0

func (x ConditionCombinator) String() string

func (ConditionCombinator) Type added in v0.2.0

type CreateIndexRequest added in v0.2.0

type CreateIndexRequest struct {
	Boundary            string              `protobuf:"bytes,1,opt,name=boundary,proto3" json:"boundary,omitempty"`
	Name                string              `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Fields              []*IndexField       `protobuf:"bytes,3,rep,name=fields,proto3" json:"fields,omitempty"`
	Conditions          []*IndexCondition   `protobuf:"bytes,4,rep,name=conditions,proto3" json:"conditions,omitempty"`
	ConditionCombinator ConditionCombinator `` /* 151-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*CreateIndexRequest) Descriptor deprecated added in v0.2.0

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

Deprecated: Use CreateIndexRequest.ProtoReflect.Descriptor instead.

func (*CreateIndexRequest) GetBoundary added in v0.2.0

func (x *CreateIndexRequest) GetBoundary() string

func (*CreateIndexRequest) GetConditionCombinator added in v0.2.0

func (x *CreateIndexRequest) GetConditionCombinator() ConditionCombinator

func (*CreateIndexRequest) GetConditions added in v0.2.0

func (x *CreateIndexRequest) GetConditions() []*IndexCondition

func (*CreateIndexRequest) GetFields added in v0.2.0

func (x *CreateIndexRequest) GetFields() []*IndexField

func (*CreateIndexRequest) GetName added in v0.2.0

func (x *CreateIndexRequest) GetName() string

func (*CreateIndexRequest) ProtoMessage added in v0.2.0

func (*CreateIndexRequest) ProtoMessage()

func (*CreateIndexRequest) ProtoReflect added in v0.2.0

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

func (*CreateIndexRequest) Reset added in v0.2.0

func (x *CreateIndexRequest) Reset()

func (*CreateIndexRequest) String added in v0.2.0

func (x *CreateIndexRequest) String() string

type CreateIndexResponse added in v0.2.0

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

func (*CreateIndexResponse) Descriptor deprecated added in v0.2.0

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

Deprecated: Use CreateIndexResponse.ProtoReflect.Descriptor instead.

func (*CreateIndexResponse) ProtoMessage added in v0.2.0

func (*CreateIndexResponse) ProtoMessage()

func (*CreateIndexResponse) ProtoReflect added in v0.2.0

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

func (*CreateIndexResponse) Reset added in v0.2.0

func (x *CreateIndexResponse) Reset()

func (*CreateIndexResponse) String added in v0.2.0

func (x *CreateIndexResponse) String() string

type CreateUserRequest

type CreateUserRequest struct {
	Name     string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Username string   `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	Password string   `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
	Roles    []string `protobuf:"bytes,4,rep,name=roles,proto3" json:"roles,omitempty"`
	// contains filtered or unexported fields
}

CreateUserRequest creates a new user

func (*CreateUserRequest) Descriptor deprecated

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

Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.

func (*CreateUserRequest) GetName

func (x *CreateUserRequest) GetName() string

func (*CreateUserRequest) GetPassword

func (x *CreateUserRequest) GetPassword() string

func (*CreateUserRequest) GetRoles

func (x *CreateUserRequest) GetRoles() []string

func (*CreateUserRequest) GetUsername

func (x *CreateUserRequest) GetUsername() string

func (*CreateUserRequest) ProtoMessage

func (*CreateUserRequest) ProtoMessage()

func (*CreateUserRequest) ProtoReflect

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

func (*CreateUserRequest) Reset

func (x *CreateUserRequest) Reset()

func (*CreateUserRequest) String

func (x *CreateUserRequest) String() string

type CreateUserResponse

type CreateUserResponse struct {
	User *AdminUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

CreateUserResponse returns the created user

func (*CreateUserResponse) Descriptor deprecated

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

Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead.

func (*CreateUserResponse) GetUser

func (x *CreateUserResponse) GetUser() *AdminUser

func (*CreateUserResponse) ProtoMessage

func (*CreateUserResponse) ProtoMessage()

func (*CreateUserResponse) ProtoReflect

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

func (*CreateUserResponse) Reset

func (x *CreateUserResponse) Reset()

func (*CreateUserResponse) String

func (x *CreateUserResponse) String() string

type Criterion

type Criterion struct {
	Tags []*Tag `protobuf:"bytes,1,rep,name=tags,proto3" json:"tags,omitempty"`
	// contains filtered or unexported fields
}

func (*Criterion) Descriptor deprecated

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

Deprecated: Use Criterion.ProtoReflect.Descriptor instead.

func (*Criterion) GetTags

func (x *Criterion) GetTags() []*Tag

func (*Criterion) ProtoMessage

func (*Criterion) ProtoMessage()

func (*Criterion) ProtoReflect

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

func (*Criterion) Reset

func (x *Criterion) Reset()

func (*Criterion) String

func (x *Criterion) String() string

type CustomEventStream

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

func NewCustomEventStream

func NewCustomEventStream(ctx context.Context) *CustomEventStream

func (*CustomEventStream) Context

func (s *CustomEventStream) Context() context.Context

func (*CustomEventStream) Events

func (s *CustomEventStream) Events() <-chan *Event

Events returns the channel for consuming events

func (*CustomEventStream) Recv

func (s *CustomEventStream) Recv() (*Event, error)

func (*CustomEventStream) Send

func (s *CustomEventStream) Send(event *Event) error

type DeleteUserRequest

type DeleteUserRequest struct {
	UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

DeleteUserRequest deletes a user by ID

func (*DeleteUserRequest) Descriptor deprecated

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

Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead.

func (*DeleteUserRequest) GetUserId

func (x *DeleteUserRequest) GetUserId() string

func (*DeleteUserRequest) ProtoMessage

func (*DeleteUserRequest) ProtoMessage()

func (*DeleteUserRequest) ProtoReflect

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

func (*DeleteUserRequest) Reset

func (x *DeleteUserRequest) Reset()

func (*DeleteUserRequest) String

func (x *DeleteUserRequest) String() string

type DeleteUserResponse

type DeleteUserResponse struct {
	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

DeleteUserResponse indicates success

func (*DeleteUserResponse) Descriptor deprecated

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

Deprecated: Use DeleteUserResponse.ProtoReflect.Descriptor instead.

func (*DeleteUserResponse) GetSuccess

func (x *DeleteUserResponse) GetSuccess() bool

func (*DeleteUserResponse) ProtoMessage

func (*DeleteUserResponse) ProtoMessage()

func (*DeleteUserResponse) ProtoReflect

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

func (*DeleteUserResponse) Reset

func (x *DeleteUserResponse) Reset()

func (*DeleteUserResponse) String

func (x *DeleteUserResponse) String() string

type Direction

type Direction int32
const (
	Direction_ASC  Direction = 0
	Direction_DESC Direction = 1
)

func (Direction) Descriptor

func (Direction) Descriptor() protoreflect.EnumDescriptor

func (Direction) Enum

func (x Direction) Enum() *Direction

func (Direction) EnumDescriptor deprecated

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

Deprecated: Use Direction.Descriptor instead.

func (Direction) Number

func (x Direction) Number() protoreflect.EnumNumber

func (Direction) String

func (x Direction) String() string

func (Direction) Type

type DropIndexRequest added in v0.2.0

type DropIndexRequest struct {
	Boundary string `protobuf:"bytes,1,opt,name=boundary,proto3" json:"boundary,omitempty"`
	Name     string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*DropIndexRequest) Descriptor deprecated added in v0.2.0

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

Deprecated: Use DropIndexRequest.ProtoReflect.Descriptor instead.

func (*DropIndexRequest) GetBoundary added in v0.2.0

func (x *DropIndexRequest) GetBoundary() string

func (*DropIndexRequest) GetName added in v0.2.0

func (x *DropIndexRequest) GetName() string

func (*DropIndexRequest) ProtoMessage added in v0.2.0

func (*DropIndexRequest) ProtoMessage()

func (*DropIndexRequest) ProtoReflect added in v0.2.0

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

func (*DropIndexRequest) Reset added in v0.2.0

func (x *DropIndexRequest) Reset()

func (*DropIndexRequest) String added in v0.2.0

func (x *DropIndexRequest) String() string

type DropIndexResponse added in v0.2.0

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

func (*DropIndexResponse) Descriptor deprecated added in v0.2.0

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

Deprecated: Use DropIndexResponse.ProtoReflect.Descriptor instead.

func (*DropIndexResponse) ProtoMessage added in v0.2.0

func (*DropIndexResponse) ProtoMessage()

func (*DropIndexResponse) ProtoReflect added in v0.2.0

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

func (*DropIndexResponse) Reset added in v0.2.0

func (x *DropIndexResponse) Reset()

func (*DropIndexResponse) String added in v0.2.0

func (x *DropIndexResponse) String() string

type Event

type Event struct {
	EventId     string                 `protobuf:"bytes,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"`
	EventType   string                 `protobuf:"bytes,2,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"`
	Data        string                 `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	Metadata    string                 `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"`
	Position    *Position              `protobuf:"bytes,6,opt,name=position,proto3" json:"position,omitempty"`
	DateCreated *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=date_created,json=dateCreated,proto3" json:"date_created,omitempty"`
	// contains filtered or unexported fields
}

func (*Event) Descriptor deprecated

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

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetData

func (x *Event) GetData() string

func (*Event) GetDateCreated

func (x *Event) GetDateCreated() *timestamppb.Timestamp

func (*Event) GetEventId

func (x *Event) GetEventId() string

func (*Event) GetEventType

func (x *Event) GetEventType() string

func (*Event) GetMetadata

func (x *Event) GetMetadata() string

func (*Event) GetPosition

func (x *Event) GetPosition() *Position

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

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

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

type EventPublishingTracker

type EventPublishingTracker interface {
	GetLastPublishedEventPosition(ctx context.Context, boundary string) (Position, error)
	InsertLastPublishedEvent(ctx context.Context, boundaryOfInterest string, transactionId int64, globalId int64) error
}

type EventStore

type EventStore struct {
	UnimplementedEventStoreServer
	// contains filtered or unexported fields
}

func InitializeEventStore

func InitializeEventStore(
	ctx context.Context,
	config c.AppConfig,
	saveEvents EventsSaver,
	getEvents EventsRetriever,
	lockProvider LockProvider,
	js jetstream.JetStream,
	logger logging.Logger) *EventStore

func NewEventStoreServer

func NewEventStoreServer(
	ctx context.Context,
	js jetstream.JetStream,
	saveEventsFn EventsSaver,
	getEventsFn EventsRetriever,
	lockProvider LockProvider,
	boundaries *[]string,
	logger logging.Logger,
) *EventStore

func (*EventStore) GetEvents

func (s *EventStore) GetEvents(ctx context.Context, req *GetEventsRequest) (*GetEventsResponse, error)

func (*EventStore) Ping

func (s *EventStore) Ping(ctx context.Context, req *PingRequest) (resp *PingResponse, err error)

func (*EventStore) SaveEvents

func (s *EventStore) SaveEvents(ctx context.Context, req *SaveEventsRequest) (resp *WriteResult, err error)

func (*EventStore) SubscribeToAllEvents

func (s *EventStore) SubscribeToAllEvents(
	ctx context.Context,
	boundary string,
	subscriberName string,
	afterPosition *Position,
	query *Query,
	handler *MessageHandler[Event],
) error

type EventStoreClient

type EventStoreClient interface {
	SaveEvents(ctx context.Context, in *SaveEventsRequest, opts ...grpc.CallOption) (*WriteResult, error)
	GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (*GetEventsResponse, error)
	CatchUpSubscribeToEvents(ctx context.Context, in *CatchUpSubscribeToEventStoreRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error)
	Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
}

EventStoreClient is the client API for EventStore 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 NewEventStoreClient

func NewEventStoreClient(cc grpc.ClientConnInterface) EventStoreClient

type EventStoreServer

type EventStoreServer interface {
	SaveEvents(context.Context, *SaveEventsRequest) (*WriteResult, error)
	GetEvents(context.Context, *GetEventsRequest) (*GetEventsResponse, error)
	CatchUpSubscribeToEvents(*CatchUpSubscribeToEventStoreRequest, grpc.ServerStreamingServer[Event]) error
	Ping(context.Context, *PingRequest) (*PingResponse, error)
	// contains filtered or unexported methods
}

EventStoreServer is the server API for EventStore service. All implementations must embed UnimplementedEventStoreServer for forward compatibility.

type EventStore_CatchUpSubscribeToEventsClient

type EventStore_CatchUpSubscribeToEventsClient = grpc.ServerStreamingClient[Event]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type EventStore_CatchUpSubscribeToEventsServer

type EventStore_CatchUpSubscribeToEventsServer = grpc.ServerStreamingServer[Event]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type EventToSave

type EventToSave struct {
	EventId   string `protobuf:"bytes,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"`
	EventType string `protobuf:"bytes,2,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"`
	Data      string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	Metadata  string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

func (*EventToSave) Descriptor deprecated

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

Deprecated: Use EventToSave.ProtoReflect.Descriptor instead.

func (*EventToSave) GetData

func (x *EventToSave) GetData() string

func (*EventToSave) GetEventId

func (x *EventToSave) GetEventId() string

func (*EventToSave) GetEventType

func (x *EventToSave) GetEventType() string

func (*EventToSave) GetMetadata

func (x *EventToSave) GetMetadata() string

func (*EventToSave) ProtoMessage

func (*EventToSave) ProtoMessage()

func (*EventToSave) ProtoReflect

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

func (*EventToSave) Reset

func (x *EventToSave) Reset()

func (*EventToSave) String

func (x *EventToSave) String() string

type EventWithMapTags

type EventWithMapTags struct {
	EventId   string `json:"event_id"`
	EventType string `json:"event_type"`
	Data      any    `json:"data"`
	Metadata  any    `json:"metadata"`
}

type EventsRetriever

type EventsRetriever interface {
	Get(ctx context.Context, req *GetEventsRequest) (*GetEventsResponse, error)
}

type EventsSaver

type EventsSaver interface {
	Save(ctx context.Context,
		events []EventWithMapTags,
		boundary string,
		expectedPosition *Position,
		subSet *Query,
	) (transactionID string, globalID int64, err error)
}

type GetEventCountRequest

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

GetEventCountRequest gets event count for a boundary

func (*GetEventCountRequest) Descriptor deprecated

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

Deprecated: Use GetEventCountRequest.ProtoReflect.Descriptor instead.

func (*GetEventCountRequest) GetBoundary

func (x *GetEventCountRequest) GetBoundary() string

func (*GetEventCountRequest) ProtoMessage

func (*GetEventCountRequest) ProtoMessage()

func (*GetEventCountRequest) ProtoReflect

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

func (*GetEventCountRequest) Reset

func (x *GetEventCountRequest) Reset()

func (*GetEventCountRequest) String

func (x *GetEventCountRequest) String() string

type GetEventCountResponse

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

GetEventCountResponse returns event count

func (*GetEventCountResponse) Descriptor deprecated

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

Deprecated: Use GetEventCountResponse.ProtoReflect.Descriptor instead.

func (*GetEventCountResponse) GetCount

func (x *GetEventCountResponse) GetCount() int64

func (*GetEventCountResponse) ProtoMessage

func (*GetEventCountResponse) ProtoMessage()

func (*GetEventCountResponse) ProtoReflect

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

func (*GetEventCountResponse) Reset

func (x *GetEventCountResponse) Reset()

func (*GetEventCountResponse) String

func (x *GetEventCountResponse) String() string

type GetEventsRequest

type GetEventsRequest struct {
	Query        *Query    `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
	FromPosition *Position `protobuf:"bytes,2,opt,name=from_position,json=fromPosition,proto3" json:"from_position,omitempty"`
	Count        uint32    `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
	Direction    Direction `protobuf:"varint,4,opt,name=direction,proto3,enum=orisun.Direction" json:"direction,omitempty"`
	Boundary     string    `protobuf:"bytes,5,opt,name=boundary,proto3" json:"boundary,omitempty"`
	// contains filtered or unexported fields
}

func (*GetEventsRequest) Descriptor deprecated

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

Deprecated: Use GetEventsRequest.ProtoReflect.Descriptor instead.

func (*GetEventsRequest) GetBoundary

func (x *GetEventsRequest) GetBoundary() string

func (*GetEventsRequest) GetCount

func (x *GetEventsRequest) GetCount() uint32

func (*GetEventsRequest) GetDirection

func (x *GetEventsRequest) GetDirection() Direction

func (*GetEventsRequest) GetFromPosition

func (x *GetEventsRequest) GetFromPosition() *Position

func (*GetEventsRequest) GetQuery

func (x *GetEventsRequest) GetQuery() *Query

func (*GetEventsRequest) ProtoMessage

func (*GetEventsRequest) ProtoMessage()

func (*GetEventsRequest) ProtoReflect

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

func (*GetEventsRequest) Reset

func (x *GetEventsRequest) Reset()

func (*GetEventsRequest) String

func (x *GetEventsRequest) String() string

type GetEventsResponse

type GetEventsResponse struct {
	Events []*Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
	// contains filtered or unexported fields
}

func (*GetEventsResponse) Descriptor deprecated

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

Deprecated: Use GetEventsResponse.ProtoReflect.Descriptor instead.

func (*GetEventsResponse) GetEvents

func (x *GetEventsResponse) GetEvents() []*Event

func (*GetEventsResponse) ProtoMessage

func (*GetEventsResponse) ProtoMessage()

func (*GetEventsResponse) ProtoReflect

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

func (*GetEventsResponse) Reset

func (x *GetEventsResponse) Reset()

func (*GetEventsResponse) String

func (x *GetEventsResponse) String() string

type GetUserCountRequest

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

GetUserCountRequest gets total user count

func (*GetUserCountRequest) Descriptor deprecated

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

Deprecated: Use GetUserCountRequest.ProtoReflect.Descriptor instead.

func (*GetUserCountRequest) ProtoMessage

func (*GetUserCountRequest) ProtoMessage()

func (*GetUserCountRequest) ProtoReflect

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

func (*GetUserCountRequest) Reset

func (x *GetUserCountRequest) Reset()

func (*GetUserCountRequest) String

func (x *GetUserCountRequest) String() string

type GetUserCountResponse

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

GetUserCountResponse returns user count

func (*GetUserCountResponse) Descriptor deprecated

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

Deprecated: Use GetUserCountResponse.ProtoReflect.Descriptor instead.

func (*GetUserCountResponse) GetCount

func (x *GetUserCountResponse) GetCount() int64

func (*GetUserCountResponse) ProtoMessage

func (*GetUserCountResponse) ProtoMessage()

func (*GetUserCountResponse) ProtoReflect

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

func (*GetUserCountResponse) Reset

func (x *GetUserCountResponse) Reset()

func (*GetUserCountResponse) String

func (x *GetUserCountResponse) String() string

type IndexCondition added in v0.2.0

type IndexCondition struct {
	Key      string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Operator string `protobuf:"bytes,2,opt,name=operator,proto3" json:"operator,omitempty"`
	Value    string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

IndexCondition describes one predicate in the partial-index filter. Multiple conditions are combined with condition_combinator.

func (*IndexCondition) Descriptor deprecated added in v0.2.0

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

Deprecated: Use IndexCondition.ProtoReflect.Descriptor instead.

func (*IndexCondition) GetKey added in v0.2.0

func (x *IndexCondition) GetKey() string

func (*IndexCondition) GetOperator added in v0.2.0

func (x *IndexCondition) GetOperator() string

func (*IndexCondition) GetValue added in v0.2.0

func (x *IndexCondition) GetValue() string

func (*IndexCondition) ProtoMessage added in v0.2.0

func (*IndexCondition) ProtoMessage()

func (*IndexCondition) ProtoReflect added in v0.2.0

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

func (*IndexCondition) Reset added in v0.2.0

func (x *IndexCondition) Reset()

func (*IndexCondition) String added in v0.2.0

func (x *IndexCondition) String() string

type IndexField added in v0.2.0

type IndexField struct {
	JsonKey   string    `protobuf:"bytes,1,opt,name=json_key,json=jsonKey,proto3" json:"json_key,omitempty"`
	ValueType ValueType `protobuf:"varint,2,opt,name=value_type,json=valueType,proto3,enum=orisun.ValueType" json:"value_type,omitempty"`
	// contains filtered or unexported fields
}

IndexField describes one key to include in the index expression. Multiple fields produce a composite index.

func (*IndexField) Descriptor deprecated added in v0.2.0

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

Deprecated: Use IndexField.ProtoReflect.Descriptor instead.

func (*IndexField) GetJsonKey added in v0.2.0

func (x *IndexField) GetJsonKey() string

func (*IndexField) GetValueType added in v0.2.0

func (x *IndexField) GetValueType() ValueType

func (*IndexField) ProtoMessage added in v0.2.0

func (*IndexField) ProtoMessage()

func (*IndexField) ProtoReflect added in v0.2.0

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

func (*IndexField) Reset added in v0.2.0

func (x *IndexField) Reset()

func (*IndexField) String added in v0.2.0

func (x *IndexField) String() string

type JetStreamLockProvider

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

JetStreamLockProvider implements the LockProvider interface using NATS JetStream

func NewJetStreamLockProvider

func NewJetStreamLockProvider(ctx context.Context, js jetstream.JetStream, logger logging.Logger) (*JetStreamLockProvider, error)

NewJetStreamLockProvider creates a new JetStreamLockProvider

func (*JetStreamLockProvider) Lock

func (p *JetStreamLockProvider) Lock(ctx context.Context, lockName string) error

Lock acquires a distributed lock with the given name The lock is automatically released when the context is done

type ListUsersRequest

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

ListUsersRequest lists all users

func (*ListUsersRequest) Descriptor deprecated

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

Deprecated: Use ListUsersRequest.ProtoReflect.Descriptor instead.

func (*ListUsersRequest) ProtoMessage

func (*ListUsersRequest) ProtoMessage()

func (*ListUsersRequest) ProtoReflect

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

func (*ListUsersRequest) Reset

func (x *ListUsersRequest) Reset()

func (*ListUsersRequest) String

func (x *ListUsersRequest) String() string

type ListUsersResponse

type ListUsersResponse struct {
	Users []*AdminUser `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
	// contains filtered or unexported fields
}

ListUsersResponse returns list of users

func (*ListUsersResponse) Descriptor deprecated

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

Deprecated: Use ListUsersResponse.ProtoReflect.Descriptor instead.

func (*ListUsersResponse) GetUsers

func (x *ListUsersResponse) GetUsers() []*AdminUser

func (*ListUsersResponse) ProtoMessage

func (*ListUsersResponse) ProtoMessage()

func (*ListUsersResponse) ProtoReflect

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

func (*ListUsersResponse) Reset

func (x *ListUsersResponse) Reset()

func (*ListUsersResponse) String

func (x *ListUsersResponse) String() string

type LockProvider

type LockProvider interface {
	Lock(ctx context.Context, lockName string) error
}

type MessageHandler

type MessageHandler[T any] struct {
	// contains filtered or unexported fields
}

func NewMessageHandler

func NewMessageHandler[T any](ctx context.Context) *MessageHandler[T]

Add constructor and methods for the generic stream

func NewMessageHandlerWithBuffer

func NewMessageHandlerWithBuffer[T any](ctx context.Context, bufferSize int) *MessageHandler[T]

NewMessageHandlerWithBuffer allows configuring the internal buffer size

func (*MessageHandler[T]) Close

func (s *MessageHandler[T]) Close()

Close marks the handler as closed to prevent further sends

func (*MessageHandler[T]) Context

func (s *MessageHandler[T]) Context() context.Context

func (*MessageHandler[T]) Recv

func (s *MessageHandler[T]) Recv() (*T, error)

func (*MessageHandler[T]) Send

func (s *MessageHandler[T]) Send(event *T) error

func (*MessageHandler[T]) TrySend

func (s *MessageHandler[T]) TrySend(event *T) error

TrySend attempts to enqueue without blocking and returns ErrQueueFull if buffer is full

type OrisunServer

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

OrisunServer provides a high-level interface to interact with the Orisun event store

func NewOrisunServer

func NewOrisunServer(
	ctx context.Context,
	saveEvents EventsSaver,
	getEvents EventsRetriever,
	lockProvider LockProvider,
	js jetstream.JetStream,
	boundaryNames []string,
	logger logging.Logger,
) (*OrisunServer, error)

NewOrisunServer creates a new Orisun client with the provided configuration

func (*OrisunServer) GetEvents

GetEvents retrieves events from the event store based on the request

func (*OrisunServer) SaveEvents

func (c *OrisunServer) SaveEvents(ctx context.Context, events []EventWithMapTags, boundary string,
	expectedPosition *Position, streamSubSet *Query) (*Position, error)

SaveEvents saves a batch of events to the event store

func (*OrisunServer) SubscribeToEvents

func (c *OrisunServer) SubscribeToEvents(
	ctx context.Context,
	boundary string,
	subscriberName string,
	afterPosition *Position, query *Query,
	handler *MessageHandler[Event],
) error

SubscribeToEvents subscribes to events from a boundary with the given handler

type PingRequest

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

func (*PingRequest) Descriptor deprecated

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

Deprecated: Use PingRequest.ProtoReflect.Descriptor instead.

func (*PingRequest) ProtoMessage

func (*PingRequest) ProtoMessage()

func (*PingRequest) ProtoReflect

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

func (*PingRequest) Reset

func (x *PingRequest) Reset()

func (*PingRequest) String

func (x *PingRequest) String() string

type PingResponse

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

func (*PingResponse) Descriptor deprecated

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

Deprecated: Use PingResponse.ProtoReflect.Descriptor instead.

func (*PingResponse) ProtoMessage

func (*PingResponse) ProtoMessage()

func (*PingResponse) ProtoReflect

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

func (*PingResponse) Reset

func (x *PingResponse) Reset()

func (*PingResponse) String

func (x *PingResponse) String() string

type Position

type Position struct {
	CommitPosition  int64 `protobuf:"varint,1,opt,name=commit_position,json=commitPosition,proto3" json:"commit_position,omitempty"`
	PreparePosition int64 `protobuf:"varint,2,opt,name=prepare_position,json=preparePosition,proto3" json:"prepare_position,omitempty"`
	// contains filtered or unexported fields
}

func FirstPosition

func FirstPosition() Position

func NotExistsPosition

func NotExistsPosition() Position

func (*Position) Descriptor deprecated

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

Deprecated: Use Position.ProtoReflect.Descriptor instead.

func (*Position) GetCommitPosition

func (x *Position) GetCommitPosition() int64

func (*Position) GetPreparePosition

func (x *Position) GetPreparePosition() int64

func (*Position) ProtoMessage

func (*Position) ProtoMessage()

func (*Position) ProtoReflect

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

func (*Position) Reset

func (x *Position) Reset()

func (*Position) String

func (x *Position) String() string

type Query

type Query struct {
	Criteria []*Criterion `protobuf:"bytes,1,rep,name=criteria,proto3" json:"criteria,omitempty"`
	// contains filtered or unexported fields
}

func (*Query) Descriptor deprecated

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

Deprecated: Use Query.ProtoReflect.Descriptor instead.

func (*Query) GetCriteria

func (x *Query) GetCriteria() []*Criterion

func (*Query) ProtoMessage

func (*Query) ProtoMessage()

func (*Query) ProtoReflect

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

func (*Query) Reset

func (x *Query) Reset()

func (*Query) String

func (x *Query) String() string

type Role

type Role string
const (
	RoleAdmin      Role = "ADMIN"
	RoleOperations Role = "OPERATIONS"
)

func (Role) String

func (r Role) String() string

type SaveEventsRequest

type SaveEventsRequest struct {
	Boundary string         `protobuf:"bytes,2,opt,name=boundary,proto3" json:"boundary,omitempty"`
	Query    *SaveQuery     `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
	Events   []*EventToSave `protobuf:"bytes,4,rep,name=events,proto3" json:"events,omitempty"`
	// contains filtered or unexported fields
}

func (*SaveEventsRequest) Descriptor deprecated

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

Deprecated: Use SaveEventsRequest.ProtoReflect.Descriptor instead.

func (*SaveEventsRequest) GetBoundary

func (x *SaveEventsRequest) GetBoundary() string

func (*SaveEventsRequest) GetEvents

func (x *SaveEventsRequest) GetEvents() []*EventToSave

func (*SaveEventsRequest) GetQuery

func (x *SaveEventsRequest) GetQuery() *SaveQuery

func (*SaveEventsRequest) ProtoMessage

func (*SaveEventsRequest) ProtoMessage()

func (*SaveEventsRequest) ProtoReflect

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

func (*SaveEventsRequest) Reset

func (x *SaveEventsRequest) Reset()

func (*SaveEventsRequest) String

func (x *SaveEventsRequest) String() string

type SaveQuery

type SaveQuery struct {
	ExpectedPosition *Position `protobuf:"bytes,1,opt,name=expected_position,json=expectedPosition,proto3" json:"expected_position,omitempty"`
	SubsetQuery      *Query    `protobuf:"bytes,2,opt,name=subsetQuery,proto3" json:"subsetQuery,omitempty"`
	// contains filtered or unexported fields
}

func (*SaveQuery) Descriptor deprecated

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

Deprecated: Use SaveQuery.ProtoReflect.Descriptor instead.

func (*SaveQuery) GetExpectedPosition

func (x *SaveQuery) GetExpectedPosition() *Position

func (*SaveQuery) GetSubsetQuery

func (x *SaveQuery) GetSubsetQuery() *Query

func (*SaveQuery) ProtoMessage

func (*SaveQuery) ProtoMessage()

func (*SaveQuery) ProtoReflect

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

func (*SaveQuery) Reset

func (x *SaveQuery) Reset()

func (*SaveQuery) String

func (x *SaveQuery) String() string

type Tag

type Tag struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Tag) Descriptor deprecated

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

Deprecated: Use Tag.ProtoReflect.Descriptor instead.

func (*Tag) GetKey

func (x *Tag) GetKey() string

func (*Tag) GetValue

func (x *Tag) GetValue() string

func (*Tag) ProtoMessage

func (*Tag) ProtoMessage()

func (*Tag) ProtoReflect

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

func (*Tag) Reset

func (x *Tag) Reset()

func (*Tag) String

func (x *Tag) String() string

type UnimplementedAdminServer

type UnimplementedAdminServer struct{}

UnimplementedAdminServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedAdminServer) ChangePassword

func (UnimplementedAdminServer) CreateIndex added in v0.2.0

func (UnimplementedAdminServer) CreateUser

func (UnimplementedAdminServer) DeleteUser

func (UnimplementedAdminServer) DropIndex added in v0.2.0

func (UnimplementedAdminServer) GetEventCount

func (UnimplementedAdminServer) GetUserCount

func (UnimplementedAdminServer) ListUsers

type UnimplementedEventStoreServer

type UnimplementedEventStoreServer struct{}

UnimplementedEventStoreServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedEventStoreServer) GetEvents

func (UnimplementedEventStoreServer) Ping

func (UnimplementedEventStoreServer) SaveEvents

type UnsafeAdminServer

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

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

type UnsafeEventStoreServer

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

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

type User

type User struct {
	Id             string `json:"id"`
	Name           string `json:"name"`
	Username       string `json:"username"`
	HashedPassword string `json:"password_hash"`
	Roles          []Role `json:"roles"`
}

type UserContextKeyType

type UserContextKeyType string
const UserContextKey UserContextKeyType = "user"

type ValidateCredentialsRequest

type ValidateCredentialsRequest struct {
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

ValidateCredentialsRequest validates username/password

func (*ValidateCredentialsRequest) Descriptor deprecated

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

Deprecated: Use ValidateCredentialsRequest.ProtoReflect.Descriptor instead.

func (*ValidateCredentialsRequest) GetPassword

func (x *ValidateCredentialsRequest) GetPassword() string

func (*ValidateCredentialsRequest) GetUsername

func (x *ValidateCredentialsRequest) GetUsername() string

func (*ValidateCredentialsRequest) ProtoMessage

func (*ValidateCredentialsRequest) ProtoMessage()

func (*ValidateCredentialsRequest) ProtoReflect

func (*ValidateCredentialsRequest) Reset

func (x *ValidateCredentialsRequest) Reset()

func (*ValidateCredentialsRequest) String

func (x *ValidateCredentialsRequest) String() string

type ValidateCredentialsResponse

type ValidateCredentialsResponse struct {
	Success bool       `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	User    *AdminUser `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

ValidateCredentialsResponse returns validation result

func (*ValidateCredentialsResponse) Descriptor deprecated

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

Deprecated: Use ValidateCredentialsResponse.ProtoReflect.Descriptor instead.

func (*ValidateCredentialsResponse) GetSuccess

func (x *ValidateCredentialsResponse) GetSuccess() bool

func (*ValidateCredentialsResponse) GetUser

func (x *ValidateCredentialsResponse) GetUser() *AdminUser

func (*ValidateCredentialsResponse) ProtoMessage

func (*ValidateCredentialsResponse) ProtoMessage()

func (*ValidateCredentialsResponse) ProtoReflect

func (*ValidateCredentialsResponse) Reset

func (x *ValidateCredentialsResponse) Reset()

func (*ValidateCredentialsResponse) String

func (x *ValidateCredentialsResponse) String() string

type ValueType added in v0.2.0

type ValueType int32
const (
	ValueType_TEXT        ValueType = 0
	ValueType_NUMERIC     ValueType = 1
	ValueType_BOOLEAN     ValueType = 2
	ValueType_TIMESTAMPTZ ValueType = 3
)

func (ValueType) Descriptor added in v0.2.0

func (ValueType) Descriptor() protoreflect.EnumDescriptor

func (ValueType) Enum added in v0.2.0

func (x ValueType) Enum() *ValueType

func (ValueType) EnumDescriptor deprecated added in v0.2.0

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

Deprecated: Use ValueType.Descriptor instead.

func (ValueType) Number added in v0.2.0

func (x ValueType) Number() protoreflect.EnumNumber

func (ValueType) String added in v0.2.0

func (x ValueType) String() string

func (ValueType) Type added in v0.2.0

type WriteResult

type WriteResult struct {
	LogPosition *Position `protobuf:"bytes,1,opt,name=log_position,json=logPosition,proto3" json:"log_position,omitempty"`
	// contains filtered or unexported fields
}

func (*WriteResult) Descriptor deprecated

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

Deprecated: Use WriteResult.ProtoReflect.Descriptor instead.

func (*WriteResult) GetLogPosition

func (x *WriteResult) GetLogPosition() *Position

func (*WriteResult) ProtoMessage

func (*WriteResult) ProtoMessage()

func (*WriteResult) ProtoReflect

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

func (*WriteResult) Reset

func (x *WriteResult) Reset()

func (*WriteResult) String

func (x *WriteResult) String() string

Jump to

Keyboard shortcuts

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