datasource

package
v0.0.0-...-ed06964 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callbacks

type Callbacks struct {
	GRPC GrpcCallback
	HTTP HttpCallback
}

type DataSource

type DataSource interface {
	Endpoint() string
	Connect(ctx context.Context) error
	Ready() bool
	GetTraceByID(ctx context.Context, traceID string) (traces.Trace, error)
	TestConnection(ctx context.Context) model.ConnectionTestStep
	Close() error
}

func New

func NewGrpcClient

func NewGrpcClient(name string, config *datastore.GRPCClientSettings, callback GrpcCallback) DataSource

func NewHttpClient

func NewHttpClient(name string, config *datastore.HttpClientConfig, callback HttpCallback) DataSource

type GrpcCallback

type GrpcCallback func(ctx context.Context, traceID string, connection *grpc.ClientConn) (traces.Trace, error)

type GrpcClient

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

func (*GrpcClient) Close

func (client *GrpcClient) Close() error

func (*GrpcClient) Connect

func (client *GrpcClient) Connect(ctx context.Context) error

func (*GrpcClient) Endpoint

func (client *GrpcClient) Endpoint() string

func (*GrpcClient) GetTraceByID

func (client *GrpcClient) GetTraceByID(ctx context.Context, traceID string) (traces.Trace, error)

func (*GrpcClient) Ready

func (client *GrpcClient) Ready() bool

func (*GrpcClient) TestConnection

func (client *GrpcClient) TestConnection(ctx context.Context) model.ConnectionTestStep

type HttpCallback

type HttpCallback func(ctx context.Context, traceID string, client *HttpClient) (traces.Trace, error)

type HttpClient

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

func (*HttpClient) Close

func (client *HttpClient) Close() error

func (*HttpClient) Connect

func (client *HttpClient) Connect(ctx context.Context) error

func (*HttpClient) Endpoint

func (client *HttpClient) Endpoint() string

func (*HttpClient) GetTraceByID

func (client *HttpClient) GetTraceByID(ctx context.Context, traceID string) (traces.Trace, error)

func (*HttpClient) Ready

func (client *HttpClient) Ready() bool

func (*HttpClient) Request

func (client *HttpClient) Request(ctx context.Context, path, method, body string) (*http.Response, error)

func (*HttpClient) TestConnection

func (client *HttpClient) TestConnection(ctx context.Context) model.ConnectionTestStep

type SupportedDataSource

type SupportedDataSource string
var (
	GRPC SupportedDataSource = "grpc"
	HTTP SupportedDataSource = "http"
)

Jump to

Keyboard shortcuts

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