internal

package
v0.0.0-...-47b5856 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JSONEncodingVersion1 = iota
	JSONEncodingVersion2
	CBOREncodingVersion
)

enum of all known encoding formats for versioned data

View Source
const CurrentEncodingVersion = CBOREncodingVersion

Version to be used for encoding (version used for decoding is determined by data received)

View Source
const KeepAliveTickDuration = 5 * time.Second //TODO from config

Variables

View Source
var ErrPluginUnavailable = errors.New("plugin unavailable")

Functions

func DecodeVersionedBytes

func DecodeVersionedBytes(res any, vData *pb.VersionedBytes) error

func EncodeVersionedBytes

func EncodeVersionedBytes(data any, version uint32) (*pb.VersionedBytes, error)

func NewChainReaderServer

func NewChainReaderServer(impl types.ChainReader) pb.ChainReaderServer

func NewChainReaderTestClient

func NewChainReaderTestClient(conn *grpc.ClientConn) types.ChainReader

NewChainReaderTestClient is a test client for [types.ChainReader] internal users should instantiate a client directly and set all private fields

func NewCodecServer

func NewCodecServer(impl types.Codec) pb.CodecServer

func NewCodecTestClient

func NewCodecTestClient(conn *grpc.ClientConn) types.Codec

NewCodecTestClient is a test client for [types.Codec] internal users should instantiate a client directly and set all private fields

func NewTelemetryClient

func NewTelemetryClient(client types.TelemetryService) *telemetryClient

func NewTelemetryServer

func NewTelemetryServer(impl types.TelemetryService) *telemetryServer

func NewTelemetryServiceClient

func NewTelemetryServiceClient(cc grpc.ClientConnInterface) *telemetryServiceClient

func RegisterPluginMedianServer

func RegisterPluginMedianServer(server *grpc.Server, broker Broker, brokerCfg BrokerConfig, impl types.PluginMedian) error

func RegisterPluginRelayerServer

func RegisterPluginRelayerServer(server *grpc.Server, broker Broker, brokerCfg BrokerConfig, impl PluginRelayer) error

func RegisterReportingPluginServiceServer

func RegisterReportingPluginServiceServer(server *grpc.Server, broker Broker, brokerCfg BrokerConfig, impl types.ReportingPluginClient) error

func RegisterStandAloneMedianProvider

func RegisterStandAloneMedianProvider(s *grpc.Server, p types.MedianProvider)

RegisterStandAloneMedianProvider register the servers needed for a median plugin provider, this is a workaround to test the Node API on EVM until the EVM relayer is loopifyed

Types

type AutomationProvider

type AutomationProvider interface {
	NewAutomationProvider(context.Context, types.RelayArgs, types.PluginArgs) (types.AutomationProvider, error)
}

type Broker

type Broker interface {
	Accept(id uint32) (net.Listener, error)
	DialWithOptions(id uint32, opts ...grpc.DialOption) (conn *grpc.ClientConn, err error)
	NextId() uint32
}

Broker is a subset of the methods exported by *plugin.GRPCBroker.

type BrokerConfig

type BrokerConfig struct {
	StopCh <-chan struct{}
	Logger logger.Logger

	GRPCOpts // optional
}

BrokerConfig holds Broker configuration fields.

type ErrConfigDigestLen

type ErrConfigDigestLen int

func (ErrConfigDigestLen) Error

func (e ErrConfigDigestLen) Error() string

type ErrConnAccept

type ErrConnAccept struct {
	ID   uint32
	Name string
	Err  error
}

func (ErrConnAccept) Error

func (e ErrConnAccept) Error() string

func (ErrConnAccept) Unwrap

func (e ErrConnAccept) Unwrap() error

type ErrConnDial

type ErrConnDial struct {
	ID   uint32
	Name string
	Err  error
}

func (ErrConnDial) Error

func (e ErrConnDial) Error() string

func (ErrConnDial) Unwrap

func (e ErrConnDial) Unwrap() error

type ErrUint8Bounds

type ErrUint8Bounds struct {
	U    uint32
	Name string
}

func (ErrUint8Bounds) Error

func (e ErrUint8Bounds) Error() string

type FunctionsProvider

type FunctionsProvider interface {
	NewFunctionsProvider(context.Context, types.RelayArgs, types.PluginArgs) (types.FunctionsProvider, error)
}

type GRPCClientConn

type GRPCClientConn interface {
	// ClientConn returns the underlying client connection.
	ClientConn() grpc.ClientConnInterface
}

GRPCClientConn is implemented by clients to expose their connection for efficient proxying.

type GRPCOpts

type GRPCOpts struct {
	// Optionally include additional options when dialing a client.
	// Normally aligned with [plugin.ClientConfig.GRPCDialOptions].
	DialOpts []grpc.DialOption
	// Optionally override the default *grpc.Server constructor.
	// Normally aligned with [plugin.ServeConfig.GRPCServer].
	NewServer func([]grpc.ServerOption) *grpc.Server
}

GRPCOpts has GRPC client and server options.

type MedianProvider

type MedianProvider interface {
	NewMedianProvider(context.Context, types.RelayArgs, types.PluginArgs) (types.MedianProvider, error)
}

type MedianProviderServer

type MedianProviderServer struct{}

func (MedianProviderServer) ConnToProvider

func (m MedianProviderServer) ConnToProvider(conn grpc.ClientConnInterface, broker Broker, brokerCfg BrokerConfig) types.MedianProvider

type MercuryProvider

type MercuryProvider interface {
	NewMercuryProvider(context.Context, types.RelayArgs, types.PluginArgs) (types.MercuryProvider, error)
}

type PluginMedianClient

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

func NewPluginMedianClient

func NewPluginMedianClient(broker Broker, brokerCfg BrokerConfig, conn *grpc.ClientConn) *PluginMedianClient

func (PluginMedianClient) Close

func (s PluginMedianClient) Close() error

func (PluginMedianClient) HealthReport

func (s PluginMedianClient) HealthReport() map[string]error

func (PluginMedianClient) Name

func (s PluginMedianClient) Name() string

func (*PluginMedianClient) NewMedianFactory

func (m *PluginMedianClient) NewMedianFactory(ctx context.Context, provider types.MedianProvider, dataSource, juelsPerFeeCoin median.DataSource, errorLog types.ErrorLog) (types.ReportingPluginFactory, error)

func (PluginMedianClient) Ready

func (s PluginMedianClient) Ready() error

func (PluginMedianClient) Refresh

func (p PluginMedianClient) Refresh(broker Broker, conn *grpc.ClientConn)

func (PluginMedianClient) Start

func (s PluginMedianClient) Start(ctx context.Context) error

type PluginProviderServer

type PluginProviderServer struct{}

func (PluginProviderServer) ConnToProvider

func (p PluginProviderServer) ConnToProvider(conn grpc.ClientConnInterface, broker Broker, brokerCfg BrokerConfig) types.PluginProvider

type PluginRelayer

type PluginRelayer interface {
	NewRelayer(ctx context.Context, config string, keystore types.Keystore) (Relayer, error)
}

type PluginRelayerClient

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

func NewPluginRelayerClient

func NewPluginRelayerClient(broker Broker, brokerCfg BrokerConfig, conn *grpc.ClientConn) *PluginRelayerClient

func (*PluginRelayerClient) NewRelayer

func (p *PluginRelayerClient) NewRelayer(ctx context.Context, config string, keystore types.Keystore) (Relayer, error)

func (PluginRelayerClient) Refresh

func (p PluginRelayerClient) Refresh(broker Broker, conn *grpc.ClientConn)

type PluginService

type PluginService[P grpcPlugin, S services.Service] struct {
	services.StateMachine

	Service S
	// contains filtered or unexported fields
}

pluginService is a [types.Service] wrapper that maintains an internal [types.Service] created from a [grpcPlugin] client instance by launching and re-launching as necessary.

func (*PluginService[P, S]) Close

func (s *PluginService[P, S]) Close() error

func (*PluginService[P, S]) HealthReport

func (s *PluginService[P, S]) HealthReport() map[string]error

func (*PluginService[P, S]) Init

func (s *PluginService[P, S]) Init(pluginName string, p P, newService func(context.Context, any) (S, error), lggr logger.Logger, cmd func() *exec.Cmd, stopCh chan struct{})

func (*PluginService[P, S]) Name

func (s *PluginService[P, S]) Name() string

func (*PluginService[P, S]) Ready

func (s *PluginService[P, S]) Ready() error

func (*PluginService[P, S]) Start

func (s *PluginService[P, S]) Start(context.Context) error

func (*PluginService[P, S]) Wait

func (s *PluginService[P, S]) Wait() error

Wait is the context-ignorant version of WaitCtx above.

func (*PluginService[P, S]) WaitCtx

func (s *PluginService[P, S]) WaitCtx(ctx context.Context) error

WaitCtx waits for the service to start up until `ctx.Done` is triggered or it receives the stop signal.

func (*PluginService[P, S]) XXXTestHook

func (s *PluginService[P, S]) XXXTestHook() TestPluginService[P, S]

XXXTestHook returns a TestPluginService. It must only be called once, and before Start.

type Relayer

type Relayer interface {
	types.ChainService
	NewPluginProvider(context.Context, types.RelayArgs, types.PluginArgs) (types.PluginProvider, error)
}

Relayer extends [types.Relayer] and includes [context.Context]s.

type ReportingPluginServiceClient

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

func NewReportingPluginServiceClient

func NewReportingPluginServiceClient(broker Broker, brokerCfg BrokerConfig, conn *grpc.ClientConn) *ReportingPluginServiceClient

func (ReportingPluginServiceClient) Close

func (s ReportingPluginServiceClient) Close() error

func (ReportingPluginServiceClient) HealthReport

func (s ReportingPluginServiceClient) HealthReport() map[string]error

func (ReportingPluginServiceClient) Name

func (s ReportingPluginServiceClient) Name() string

func (*ReportingPluginServiceClient) NewReportingPluginFactory

func (ReportingPluginServiceClient) Ready

func (s ReportingPluginServiceClient) Ready() error

func (ReportingPluginServiceClient) Refresh

func (p ReportingPluginServiceClient) Refresh(broker Broker, conn *grpc.ClientConn)

func (ReportingPluginServiceClient) Start

func (s ReportingPluginServiceClient) Start(ctx context.Context) error

type TestPluginService

type TestPluginService[P grpcPlugin, S services.Service] chan<- func(*PluginService[P, S])

TestPluginService supports Killing & Resetting a running *pluginService.

func (TestPluginService[P, S]) Kill

func (ch TestPluginService[P, S]) Kill()

func (TestPluginService[P, S]) Reset

func (ch TestPluginService[P, S]) Reset()

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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