client

package
v1.16.23-beta002 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package client is a generated GoMock package.

Package client is a generated GoMock package.

Package client is a generated GoMock package.

Package client is a generated GoMock package.

Index

Constants

View Source
const (
	StreamPrefix = "log"

	StartSubject = "events.logs.start"
	StopSubject  = "events.logs.stop"
)
View Source
const ConsumerPrefix = "lc"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Get(ctx context.Context, id string) chan events.LogResponse
}

func NewGrpcClient

func NewGrpcClient(address string) Client

type GrpcClient

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

func (GrpcClient) Get

func (c GrpcClient) Get(ctx context.Context, id string) chan events.LogResponse

Get returns channel with log stream chunks for given execution id connects through GRPC to log service

type InitializedStreamGetter added in v1.16.25

type InitializedStreamGetter interface {
	StreamInitializer
	StreamGetter
}

type InitializedStreamPusher added in v1.16.25

type InitializedStreamPusher interface {
	StreamInitializer
	StreamPusher
}

type LogResponse

type LogResponse struct {
	Log   events.Log
	Error error
}

type MockClient added in v1.16.26

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

MockClient is a mock of Client interface.

func NewMockClient added in v1.16.26

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) EXPECT added in v1.16.26

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClient) Get added in v1.16.26

func (m *MockClient) Get(arg0 context.Context, arg1 string) chan events.LogResponse

Get mocks base method.

type MockClientMockRecorder added in v1.16.26

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) Get added in v1.16.26

func (mr *MockClientMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call

Get indicates an expected call of Get.

type MockInitializedStreamGetter added in v1.16.25

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

MockInitializedStreamGetter is a mock of InitializedStreamGetter interface.

func NewMockInitializedStreamGetter added in v1.16.25

func NewMockInitializedStreamGetter(ctrl *gomock.Controller) *MockInitializedStreamGetter

NewMockInitializedStreamGetter creates a new mock instance.

func (*MockInitializedStreamGetter) EXPECT added in v1.16.25

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockInitializedStreamGetter) Get added in v1.16.25

Get mocks base method.

func (*MockInitializedStreamGetter) Init added in v1.16.25

Init mocks base method.

type MockInitializedStreamGetterMockRecorder added in v1.16.25

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

MockInitializedStreamGetterMockRecorder is the mock recorder for MockInitializedStreamGetter.

func (*MockInitializedStreamGetterMockRecorder) Get added in v1.16.25

func (mr *MockInitializedStreamGetterMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockInitializedStreamGetterMockRecorder) Init added in v1.16.25

func (mr *MockInitializedStreamGetterMockRecorder) Init(arg0, arg1 interface{}) *gomock.Call

Init indicates an expected call of Init.

type MockInitializedStreamPusher added in v1.16.25

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

MockInitializedStreamPusher is a mock of InitializedStreamPusher interface.

func NewMockInitializedStreamPusher added in v1.16.25

func NewMockInitializedStreamPusher(ctrl *gomock.Controller) *MockInitializedStreamPusher

NewMockInitializedStreamPusher creates a new mock instance.

func (*MockInitializedStreamPusher) EXPECT added in v1.16.25

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockInitializedStreamPusher) Init added in v1.16.25

Init mocks base method.

func (*MockInitializedStreamPusher) Push added in v1.16.25

func (m *MockInitializedStreamPusher) Push(arg0 context.Context, arg1 string, arg2 events.Log) error

Push mocks base method.

func (*MockInitializedStreamPusher) PushBytes added in v1.16.25

func (m *MockInitializedStreamPusher) PushBytes(arg0 context.Context, arg1 string, arg2 []byte) error

PushBytes mocks base method.

type MockInitializedStreamPusherMockRecorder added in v1.16.25

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

MockInitializedStreamPusherMockRecorder is the mock recorder for MockInitializedStreamPusher.

func (*MockInitializedStreamPusherMockRecorder) Init added in v1.16.25

func (mr *MockInitializedStreamPusherMockRecorder) Init(arg0, arg1 interface{}) *gomock.Call

Init indicates an expected call of Init.

func (*MockInitializedStreamPusherMockRecorder) Push added in v1.16.25

func (mr *MockInitializedStreamPusherMockRecorder) Push(arg0, arg1, arg2 interface{}) *gomock.Call

Push indicates an expected call of Push.

func (*MockInitializedStreamPusherMockRecorder) PushBytes added in v1.16.25

func (mr *MockInitializedStreamPusherMockRecorder) PushBytes(arg0, arg1, arg2 interface{}) *gomock.Call

PushBytes indicates an expected call of PushBytes.

type MockStream added in v1.16.25

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

MockStream is a mock of Stream interface.

func NewMockStream added in v1.16.25

func NewMockStream(ctrl *gomock.Controller) *MockStream

NewMockStream creates a new mock instance.

func (*MockStream) EXPECT added in v1.16.25

func (m *MockStream) EXPECT() *MockStreamMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockStream) Get added in v1.16.25

func (m *MockStream) Get(arg0 context.Context, arg1 string) (chan events.LogResponse, error)

Get mocks base method.

func (*MockStream) Init added in v1.16.25

func (m *MockStream) Init(arg0 context.Context, arg1 string) (StreamMetadata, error)

Init mocks base method.

func (*MockStream) Push added in v1.16.25

func (m *MockStream) Push(arg0 context.Context, arg1 string, arg2 events.Log) error

Push mocks base method.

func (*MockStream) PushBytes added in v1.16.25

func (m *MockStream) PushBytes(arg0 context.Context, arg1 string, arg2 []byte) error

PushBytes mocks base method.

func (*MockStream) Start added in v1.16.25

func (m *MockStream) Start(arg0 context.Context, arg1 string) (StreamResponse, error)

Start mocks base method.

func (*MockStream) Stop added in v1.16.25

func (m *MockStream) Stop(arg0 context.Context, arg1 string) (StreamResponse, error)

Stop mocks base method.

type MockStreamMockRecorder added in v1.16.25

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

MockStreamMockRecorder is the mock recorder for MockStream.

func (*MockStreamMockRecorder) Get added in v1.16.25

func (mr *MockStreamMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockStreamMockRecorder) Init added in v1.16.25

func (mr *MockStreamMockRecorder) Init(arg0, arg1 interface{}) *gomock.Call

Init indicates an expected call of Init.

func (*MockStreamMockRecorder) Push added in v1.16.25

func (mr *MockStreamMockRecorder) Push(arg0, arg1, arg2 interface{}) *gomock.Call

Push indicates an expected call of Push.

func (*MockStreamMockRecorder) PushBytes added in v1.16.25

func (mr *MockStreamMockRecorder) PushBytes(arg0, arg1, arg2 interface{}) *gomock.Call

PushBytes indicates an expected call of PushBytes.

func (*MockStreamMockRecorder) Start added in v1.16.25

func (mr *MockStreamMockRecorder) Start(arg0, arg1 interface{}) *gomock.Call

Start indicates an expected call of Start.

func (*MockStreamMockRecorder) Stop added in v1.16.25

func (mr *MockStreamMockRecorder) Stop(arg0, arg1 interface{}) *gomock.Call

Stop indicates an expected call of Stop.

type NatsLogStream

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

func (NatsLogStream) Get

func (c NatsLogStream) Get(ctx context.Context, id string) (chan events.LogResponse, error)

Get returns channel with log stream chunks for given execution id connects through GRPC to log service

func (NatsLogStream) Init

func (NatsLogStream) Push

func (c NatsLogStream) Push(ctx context.Context, id string, chunk events.Log) error

Push log chunk to NATS stream

func (NatsLogStream) PushBytes

func (c NatsLogStream) PushBytes(ctx context.Context, id string, chunk []byte) error

Push log chunk to NATS stream TODO handle message repeat with backoff strategy on error

func (NatsLogStream) Start

func (c NatsLogStream) Start(ctx context.Context, id string) (resp StreamResponse, err error)

Start emits start event to the stream - logs service will handle start and create new stream

func (NatsLogStream) Stop

func (c NatsLogStream) Stop(ctx context.Context, id string) (resp StreamResponse, err error)

Stop emits stop event to the stream and waits for given stream to be stopped fully - logs service will handle stop and close stream and all subscribers

type Stream

func NewNatsLogStream

func NewNatsLogStream(nc *nats.Conn) (s Stream, err error)

type StreamConfigurer

type StreamConfigurer interface {
	// Init creates or updates stream on demand
	WithAddress(address string) Stream
}

type StreamGetter

type StreamGetter interface {
	// Init creates or updates stream on demand
	Get(ctx context.Context, id string) (chan events.LogResponse, error)
}

LogStream is a single log stream chunk with possible errors

type StreamInitializer

type StreamInitializer interface {
	// Init creates or updates stream on demand
	Init(ctx context.Context, id string) (meta StreamMetadata, err error)
}

type StreamMetadata

type StreamMetadata struct {
	Name string
}

type StreamPusher

type StreamPusher interface {
	// Push sends logs to log stream
	Push(ctx context.Context, id string, chunk events.Log) error
	// PushBytes sends RAW bytes to log stream, developer is responsible for marshaling valid data
	PushBytes(ctx context.Context, id string, chunk []byte) error
}

type StreamResponse

type StreamResponse struct {
	Message []byte
	Error   bool
}

type StreamTrigger

type StreamTrigger interface {
	// Trigger start event
	Start(ctx context.Context, id string) (StreamResponse, error)
	// Trigger stop event
	Stop(ctx context.Context, id string) (StreamResponse, error)
}

Jump to

Keyboard shortcuts

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