types

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	// DaemonStartupGracePeriod is the amount of time to wait for before a daemon is expected to start querying
	// the daemon server. This is used to ensure that spurious panics aren't produced due to the daemons waiting for
	// the cosmos grpc service to start. If cli tests are failing due to panics because it is taking the network
	// a long time to start the protocol, it's possible this value could be increased.
	DaemonStartupGracePeriod = 60 * time.Second

	// MaximumLoopDelayMultiple defines the maximum acceptable update delay for a daemon as a multiple of the
	// daemon's loop delay.
	MaximumLoopDelayMultiple = 3

	PricefeedDaemonServiceName = "pricefeed-daemon"
)
View Source
const (
	// HealthCheckPollFrequency is the frequency at which the health-checkable service is polled.
	HealthCheckPollFrequency = 5 * time.Second

	// HealthMonitorLogModuleName is the module name used for logging within the health monitor.
	HealthMonitorLogModuleName = "daemon-health-monitor"
)

Variables

View Source
var (
	ErrInvalidLengthMedianValues        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMedianValues          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMedianValues = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthPricefeed        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPricefeed          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPricefeed = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTokenBridge        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTokenBridge          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTokenBridge = fmt.Errorf("proto: unexpected end of group")
)

Functions

func LogErrorServiceNotResponding

func LogErrorServiceNotResponding(hc types.HealthCheckable, logger log.Logger) func(error)

LogErrorServiceNotResponding returns a function that logs an error indicating that the specified service is not responding. This is ideal for creating a callback function when registering a health-checkable service.

func PanicServiceNotResponding

func PanicServiceNotResponding(hc types.HealthCheckable) func(error)

PanicServiceNotResponding returns a function that panics with a message indicating that the specified daemon service is not responding. This is ideal for creating a callback function when registering a daemon service.

func RegisterMedianValuesServiceHandler

func RegisterMedianValuesServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterMedianValuesServiceHandler registers the http handlers for service MedianValuesService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterMedianValuesServiceHandlerClient

func RegisterMedianValuesServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MedianValuesServiceClient) error

RegisterMedianValuesServiceHandlerClient registers the http handlers for service MedianValuesService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MedianValuesServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MedianValuesServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MedianValuesServiceClient" to call the correct interceptors.

func RegisterMedianValuesServiceHandlerFromEndpoint

func RegisterMedianValuesServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterMedianValuesServiceHandlerFromEndpoint is same as RegisterMedianValuesServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterMedianValuesServiceHandlerServer

func RegisterMedianValuesServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MedianValuesServiceServer) error

RegisterMedianValuesServiceHandlerServer registers the http handlers for service MedianValuesService to "mux". UnaryRPC :call MedianValuesServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMedianValuesServiceHandlerFromEndpoint instead.

func RegisterMedianValuesServiceServer

func RegisterMedianValuesServiceServer(s grpc1.Server, srv MedianValuesServiceServer)

func RegisterPriceFeedServiceServer

func RegisterPriceFeedServiceServer(s grpc1.Server, srv PriceFeedServiceServer)

func RegisterTokenBridgeServiceHandler

func RegisterTokenBridgeServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterTokenBridgeServiceHandler registers the http handlers for service TokenBridgeService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterTokenBridgeServiceHandlerClient

func RegisterTokenBridgeServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TokenBridgeServiceClient) error

RegisterTokenBridgeServiceHandlerClient registers the http handlers for service TokenBridgeService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TokenBridgeServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TokenBridgeServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TokenBridgeServiceClient" to call the correct interceptors.

func RegisterTokenBridgeServiceHandlerFromEndpoint

func RegisterTokenBridgeServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterTokenBridgeServiceHandlerFromEndpoint is same as RegisterTokenBridgeServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterTokenBridgeServiceHandlerServer

func RegisterTokenBridgeServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TokenBridgeServiceServer) error

RegisterTokenBridgeServiceHandlerServer registers the http handlers for service TokenBridgeService to "mux". UnaryRPC :call TokenBridgeServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTokenBridgeServiceHandlerFromEndpoint instead.

func RegisterTokenBridgeServiceServer

func RegisterTokenBridgeServiceServer(s grpc1.Server, srv TokenBridgeServiceServer)

func StartNewHealthChecker

func StartNewHealthChecker(
	healthCheckable types.HealthCheckable,
	pollFrequency time.Duration,
	unhealthyCallback func(error),
	timeProvider libtime.TimeProvider,
	maxUnhealthyDuration time.Duration,
	startupGracePeriod time.Duration,
	logger log.Logger,
) *healthChecker

StartNewHealthChecker creates and starts a new health checker for a health-checkable service.

Types

type ExchangePrice

type ExchangePrice struct {
	ExchangeId     string     `protobuf:"bytes,1,opt,name=exchange_id,json=exchangeId,proto3" json:"exchange_id,omitempty"`
	Price          uint64     `protobuf:"varint,2,opt,name=price,proto3" json:"price,omitempty"`
	LastUpdateTime *time.Time `protobuf:"bytes,3,opt,name=last_update_time,json=lastUpdateTime,proto3,stdtime" json:"last_update_time,omitempty"`
}

ExchangePrice represents a specific exchange's market price

func (*ExchangePrice) Descriptor

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

func (*ExchangePrice) GetExchangeId

func (m *ExchangePrice) GetExchangeId() string

func (*ExchangePrice) GetLastUpdateTime

func (m *ExchangePrice) GetLastUpdateTime() *time.Time

func (*ExchangePrice) GetPrice

func (m *ExchangePrice) GetPrice() uint64

func (*ExchangePrice) Marshal

func (m *ExchangePrice) Marshal() (dAtA []byte, err error)

func (*ExchangePrice) MarshalTo

func (m *ExchangePrice) MarshalTo(dAtA []byte) (int, error)

func (*ExchangePrice) MarshalToSizedBuffer

func (m *ExchangePrice) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ExchangePrice) ProtoMessage

func (*ExchangePrice) ProtoMessage()

func (*ExchangePrice) Reset

func (m *ExchangePrice) Reset()

func (*ExchangePrice) Size

func (m *ExchangePrice) Size() (n int)

func (*ExchangePrice) String

func (m *ExchangePrice) String() string

func (*ExchangePrice) Unmarshal

func (m *ExchangePrice) Unmarshal(dAtA []byte) error

func (*ExchangePrice) XXX_DiscardUnknown

func (m *ExchangePrice) XXX_DiscardUnknown()

func (*ExchangePrice) XXX_Marshal

func (m *ExchangePrice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ExchangePrice) XXX_Merge

func (m *ExchangePrice) XXX_Merge(src proto.Message)

func (*ExchangePrice) XXX_Size

func (m *ExchangePrice) XXX_Size() int

func (*ExchangePrice) XXX_Unmarshal

func (m *ExchangePrice) XXX_Unmarshal(b []byte) error

type GetAllMedianValuesRequest

type GetAllMedianValuesRequest struct {
}

GetAllMedianValuesRequest is the request for the GetAllMedianValues rpc

func (*GetAllMedianValuesRequest) Descriptor

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

func (*GetAllMedianValuesRequest) Marshal

func (m *GetAllMedianValuesRequest) Marshal() (dAtA []byte, err error)

func (*GetAllMedianValuesRequest) MarshalTo

func (m *GetAllMedianValuesRequest) MarshalTo(dAtA []byte) (int, error)

func (*GetAllMedianValuesRequest) MarshalToSizedBuffer

func (m *GetAllMedianValuesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GetAllMedianValuesRequest) ProtoMessage

func (*GetAllMedianValuesRequest) ProtoMessage()

func (*GetAllMedianValuesRequest) Reset

func (m *GetAllMedianValuesRequest) Reset()

func (*GetAllMedianValuesRequest) Size

func (m *GetAllMedianValuesRequest) Size() (n int)

func (*GetAllMedianValuesRequest) String

func (m *GetAllMedianValuesRequest) String() string

func (*GetAllMedianValuesRequest) Unmarshal

func (m *GetAllMedianValuesRequest) Unmarshal(dAtA []byte) error

func (*GetAllMedianValuesRequest) XXX_DiscardUnknown

func (m *GetAllMedianValuesRequest) XXX_DiscardUnknown()

func (*GetAllMedianValuesRequest) XXX_Marshal

func (m *GetAllMedianValuesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetAllMedianValuesRequest) XXX_Merge

func (m *GetAllMedianValuesRequest) XXX_Merge(src proto.Message)

func (*GetAllMedianValuesRequest) XXX_Size

func (m *GetAllMedianValuesRequest) XXX_Size() int

func (*GetAllMedianValuesRequest) XXX_Unmarshal

func (m *GetAllMedianValuesRequest) XXX_Unmarshal(b []byte) error

type GetAllMedianValuesResponse

type GetAllMedianValuesResponse struct {
	MedianValues []*MedianValues `protobuf:"bytes,1,rep,name=median_values,json=medianValues,proto3" json:"median_values,omitempty"`
}

GetAllMedianValuesResponse is the response for the GetAllMedianValues rpc

func (*GetAllMedianValuesResponse) Descriptor

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

func (*GetAllMedianValuesResponse) GetMedianValues

func (m *GetAllMedianValuesResponse) GetMedianValues() []*MedianValues

func (*GetAllMedianValuesResponse) Marshal

func (m *GetAllMedianValuesResponse) Marshal() (dAtA []byte, err error)

func (*GetAllMedianValuesResponse) MarshalTo

func (m *GetAllMedianValuesResponse) MarshalTo(dAtA []byte) (int, error)

func (*GetAllMedianValuesResponse) MarshalToSizedBuffer

func (m *GetAllMedianValuesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GetAllMedianValuesResponse) ProtoMessage

func (*GetAllMedianValuesResponse) ProtoMessage()

func (*GetAllMedianValuesResponse) Reset

func (m *GetAllMedianValuesResponse) Reset()

func (*GetAllMedianValuesResponse) Size

func (m *GetAllMedianValuesResponse) Size() (n int)

func (*GetAllMedianValuesResponse) String

func (m *GetAllMedianValuesResponse) String() string

func (*GetAllMedianValuesResponse) Unmarshal

func (m *GetAllMedianValuesResponse) Unmarshal(dAtA []byte) error

func (*GetAllMedianValuesResponse) XXX_DiscardUnknown

func (m *GetAllMedianValuesResponse) XXX_DiscardUnknown()

func (*GetAllMedianValuesResponse) XXX_Marshal

func (m *GetAllMedianValuesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetAllMedianValuesResponse) XXX_Merge

func (m *GetAllMedianValuesResponse) XXX_Merge(src proto.Message)

func (*GetAllMedianValuesResponse) XXX_Size

func (m *GetAllMedianValuesResponse) XXX_Size() int

func (*GetAllMedianValuesResponse) XXX_Unmarshal

func (m *GetAllMedianValuesResponse) XXX_Unmarshal(b []byte) error

type GetMedianValueRequest

type GetMedianValueRequest struct {
	// query data to fetch prices for
	QueryData []byte `protobuf:"bytes,1,opt,name=query_data,json=queryData,proto3" json:"query_data,omitempty"`
}

GetMedianValuesRequest is the request for the GetMedianValues rpc

func (*GetMedianValueRequest) Descriptor

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

func (*GetMedianValueRequest) GetQueryData

func (m *GetMedianValueRequest) GetQueryData() []byte

func (*GetMedianValueRequest) Marshal

func (m *GetMedianValueRequest) Marshal() (dAtA []byte, err error)

func (*GetMedianValueRequest) MarshalTo

func (m *GetMedianValueRequest) MarshalTo(dAtA []byte) (int, error)

func (*GetMedianValueRequest) MarshalToSizedBuffer

func (m *GetMedianValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GetMedianValueRequest) ProtoMessage

func (*GetMedianValueRequest) ProtoMessage()

func (*GetMedianValueRequest) Reset

func (m *GetMedianValueRequest) Reset()

func (*GetMedianValueRequest) Size

func (m *GetMedianValueRequest) Size() (n int)

func (*GetMedianValueRequest) String

func (m *GetMedianValueRequest) String() string

func (*GetMedianValueRequest) Unmarshal

func (m *GetMedianValueRequest) Unmarshal(dAtA []byte) error

func (*GetMedianValueRequest) XXX_DiscardUnknown

func (m *GetMedianValueRequest) XXX_DiscardUnknown()

func (*GetMedianValueRequest) XXX_Marshal

func (m *GetMedianValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetMedianValueRequest) XXX_Merge

func (m *GetMedianValueRequest) XXX_Merge(src proto.Message)

func (*GetMedianValueRequest) XXX_Size

func (m *GetMedianValueRequest) XXX_Size() int

func (*GetMedianValueRequest) XXX_Unmarshal

func (m *GetMedianValueRequest) XXX_Unmarshal(b []byte) error

type GetMedianValueResponse

type GetMedianValueResponse struct {
	MedianValues *MedianValues `protobuf:"bytes,1,opt,name=median_values,json=medianValues,proto3" json:"median_values,omitempty"`
}

GetMedianValueResponse is the response for the GetMedianValue rpc

func (*GetMedianValueResponse) Descriptor

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

func (*GetMedianValueResponse) GetMedianValues

func (m *GetMedianValueResponse) GetMedianValues() *MedianValues

func (*GetMedianValueResponse) Marshal

func (m *GetMedianValueResponse) Marshal() (dAtA []byte, err error)

func (*GetMedianValueResponse) MarshalTo

func (m *GetMedianValueResponse) MarshalTo(dAtA []byte) (int, error)

func (*GetMedianValueResponse) MarshalToSizedBuffer

func (m *GetMedianValueResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GetMedianValueResponse) ProtoMessage

func (*GetMedianValueResponse) ProtoMessage()

func (*GetMedianValueResponse) Reset

func (m *GetMedianValueResponse) Reset()

func (*GetMedianValueResponse) Size

func (m *GetMedianValueResponse) Size() (n int)

func (*GetMedianValueResponse) String

func (m *GetMedianValueResponse) String() string

func (*GetMedianValueResponse) Unmarshal

func (m *GetMedianValueResponse) Unmarshal(dAtA []byte) error

func (*GetMedianValueResponse) XXX_DiscardUnknown

func (m *GetMedianValueResponse) XXX_DiscardUnknown()

func (*GetMedianValueResponse) XXX_Marshal

func (m *GetMedianValueResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetMedianValueResponse) XXX_Merge

func (m *GetMedianValueResponse) XXX_Merge(src proto.Message)

func (*GetMedianValueResponse) XXX_Size

func (m *GetMedianValueResponse) XXX_Size() int

func (*GetMedianValueResponse) XXX_Unmarshal

func (m *GetMedianValueResponse) XXX_Unmarshal(b []byte) error

type GetPendingDepositReportRequest

type GetPendingDepositReportRequest struct {
}

GetPendingDepositReportRequest is a request message for getting pending bridge deposits.

func (*GetPendingDepositReportRequest) Descriptor

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

func (*GetPendingDepositReportRequest) Marshal

func (m *GetPendingDepositReportRequest) Marshal() (dAtA []byte, err error)

func (*GetPendingDepositReportRequest) MarshalTo

func (m *GetPendingDepositReportRequest) MarshalTo(dAtA []byte) (int, error)

func (*GetPendingDepositReportRequest) MarshalToSizedBuffer

func (m *GetPendingDepositReportRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GetPendingDepositReportRequest) ProtoMessage

func (*GetPendingDepositReportRequest) ProtoMessage()

func (*GetPendingDepositReportRequest) Reset

func (m *GetPendingDepositReportRequest) Reset()

func (*GetPendingDepositReportRequest) Size

func (m *GetPendingDepositReportRequest) Size() (n int)

func (*GetPendingDepositReportRequest) String

func (*GetPendingDepositReportRequest) Unmarshal

func (m *GetPendingDepositReportRequest) Unmarshal(dAtA []byte) error

func (*GetPendingDepositReportRequest) XXX_DiscardUnknown

func (m *GetPendingDepositReportRequest) XXX_DiscardUnknown()

func (*GetPendingDepositReportRequest) XXX_Marshal

func (m *GetPendingDepositReportRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetPendingDepositReportRequest) XXX_Merge

func (m *GetPendingDepositReportRequest) XXX_Merge(src proto.Message)

func (*GetPendingDepositReportRequest) XXX_Size

func (m *GetPendingDepositReportRequest) XXX_Size() int

func (*GetPendingDepositReportRequest) XXX_Unmarshal

func (m *GetPendingDepositReportRequest) XXX_Unmarshal(b []byte) error

type GetPendingDepositReportResponse

type GetPendingDepositReportResponse struct {
	QueryData []byte `protobuf:"bytes,1,opt,name=query_data,json=queryData,proto3" json:"query_data,omitempty"`
	Value     []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}

GetPendingDepositReportResponse is a response message for getting pending bridge deposits.

func (*GetPendingDepositReportResponse) Descriptor

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

func (*GetPendingDepositReportResponse) GetQueryData

func (m *GetPendingDepositReportResponse) GetQueryData() []byte

func (*GetPendingDepositReportResponse) GetValue

func (m *GetPendingDepositReportResponse) GetValue() []byte

func (*GetPendingDepositReportResponse) Marshal

func (m *GetPendingDepositReportResponse) Marshal() (dAtA []byte, err error)

func (*GetPendingDepositReportResponse) MarshalTo

func (m *GetPendingDepositReportResponse) MarshalTo(dAtA []byte) (int, error)

func (*GetPendingDepositReportResponse) MarshalToSizedBuffer

func (m *GetPendingDepositReportResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GetPendingDepositReportResponse) ProtoMessage

func (*GetPendingDepositReportResponse) ProtoMessage()

func (*GetPendingDepositReportResponse) Reset

func (*GetPendingDepositReportResponse) Size

func (m *GetPendingDepositReportResponse) Size() (n int)

func (*GetPendingDepositReportResponse) String

func (*GetPendingDepositReportResponse) Unmarshal

func (m *GetPendingDepositReportResponse) Unmarshal(dAtA []byte) error

func (*GetPendingDepositReportResponse) XXX_DiscardUnknown

func (m *GetPendingDepositReportResponse) XXX_DiscardUnknown()

func (*GetPendingDepositReportResponse) XXX_Marshal

func (m *GetPendingDepositReportResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetPendingDepositReportResponse) XXX_Merge

func (m *GetPendingDepositReportResponse) XXX_Merge(src proto.Message)

func (*GetPendingDepositReportResponse) XXX_Size

func (m *GetPendingDepositReportResponse) XXX_Size() int

func (*GetPendingDepositReportResponse) XXX_Unmarshal

func (m *GetPendingDepositReportResponse) XXX_Unmarshal(b []byte) error

type HealthMonitor

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

HealthMonitor monitors the health of daemon services, which implement the HealthCheckable interface. If a registered health-checkable service sustains an unhealthy state for the maximum acceptable unhealthy duration, the monitor will execute a callback function.

func NewHealthMonitor

func NewHealthMonitor(
	startupGracePeriod time.Duration,
	pollingFrequency time.Duration,
	logger log.Logger,
	enablePanics bool,
) *HealthMonitor

NewHealthMonitor creates a new health monitor.

func (*HealthMonitor) DisableForTesting

func (hm *HealthMonitor) DisableForTesting()

func (*HealthMonitor) RegisterService

func (hm *HealthMonitor) RegisterService(
	hc types.HealthCheckable,
	maxDaemonUnhealthyDuration time.Duration,
) error

RegisterService registers a new health-checkable service with the health check monitor. If the service is unhealthy every time it is polled for a duration greater than or equal to the maximum acceptable unhealthy duration, the monitor will panic or log an error, depending on the app configuration via the `panic-on-daemon-failure-enabled` flag. This method is synchronized. It returns an error if the service was already registered or the monitor has already been stopped. If the monitor has been stopped, this method will proactively stop the health-checkable service before returning.

func (*HealthMonitor) RegisterServiceWithCallback

func (hm *HealthMonitor) RegisterServiceWithCallback(
	hc types.HealthCheckable,
	maxUnhealthyDuration time.Duration,
	callback func(error),
) error

RegisterServiceWithCallback registers a HealthCheckable with the health monitor. If the service stays unhealthy every time it is polled during the maximum acceptable unhealthy duration, the monitor will execute the callback function. This method is synchronized. The method returns an error if the service was already registered or the monitor has already been stopped. If the monitor has been stopped, this method will proactively stop the health-checkable service before returning.

func (*HealthMonitor) Stop

func (hm *HealthMonitor) Stop()

Stop stops the update frequency monitor. This method is synchronized.

type MarketPriceUpdate

type MarketPriceUpdate struct {
	MarketId       uint32           `protobuf:"varint,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"`
	ExchangePrices []*ExchangePrice `protobuf:"bytes,2,rep,name=exchange_prices,json=exchangePrices,proto3" json:"exchange_prices,omitempty"`
}

MarketPriceUpdate represents an update to a single market

func (*MarketPriceUpdate) Descriptor

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

func (*MarketPriceUpdate) GetExchangePrices

func (m *MarketPriceUpdate) GetExchangePrices() []*ExchangePrice

func (*MarketPriceUpdate) GetMarketId

func (m *MarketPriceUpdate) GetMarketId() uint32

func (*MarketPriceUpdate) Marshal

func (m *MarketPriceUpdate) Marshal() (dAtA []byte, err error)

func (*MarketPriceUpdate) MarshalTo

func (m *MarketPriceUpdate) MarshalTo(dAtA []byte) (int, error)

func (*MarketPriceUpdate) MarshalToSizedBuffer

func (m *MarketPriceUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MarketPriceUpdate) ProtoMessage

func (*MarketPriceUpdate) ProtoMessage()

func (*MarketPriceUpdate) Reset

func (m *MarketPriceUpdate) Reset()

func (*MarketPriceUpdate) Size

func (m *MarketPriceUpdate) Size() (n int)

func (*MarketPriceUpdate) String

func (m *MarketPriceUpdate) String() string

func (*MarketPriceUpdate) Unmarshal

func (m *MarketPriceUpdate) Unmarshal(dAtA []byte) error

func (*MarketPriceUpdate) XXX_DiscardUnknown

func (m *MarketPriceUpdate) XXX_DiscardUnknown()

func (*MarketPriceUpdate) XXX_Marshal

func (m *MarketPriceUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MarketPriceUpdate) XXX_Merge

func (m *MarketPriceUpdate) XXX_Merge(src proto.Message)

func (*MarketPriceUpdate) XXX_Size

func (m *MarketPriceUpdate) XXX_Size() int

func (*MarketPriceUpdate) XXX_Unmarshal

func (m *MarketPriceUpdate) XXX_Unmarshal(b []byte) error

type MedianValues

type MedianValues struct {
	// marketId is the market id for a pair
	MarketId uint32 `protobuf:"varint,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"`
	Price    uint64 `protobuf:"varint,2,opt,name=price,proto3" json:"price,omitempty"`
	Exponent int32  `protobuf:"varint,3,opt,name=exponent,proto3" json:"exponent,omitempty"`
}

MedianValues is the median value for a market

func (*MedianValues) Descriptor

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

func (*MedianValues) GetExponent

func (m *MedianValues) GetExponent() int32

func (*MedianValues) GetMarketId

func (m *MedianValues) GetMarketId() uint32

func (*MedianValues) GetPrice

func (m *MedianValues) GetPrice() uint64

func (*MedianValues) Marshal

func (m *MedianValues) Marshal() (dAtA []byte, err error)

func (*MedianValues) MarshalTo

func (m *MedianValues) MarshalTo(dAtA []byte) (int, error)

func (*MedianValues) MarshalToSizedBuffer

func (m *MedianValues) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MedianValues) ProtoMessage

func (*MedianValues) ProtoMessage()

func (*MedianValues) Reset

func (m *MedianValues) Reset()

func (*MedianValues) Size

func (m *MedianValues) Size() (n int)

func (*MedianValues) String

func (m *MedianValues) String() string

func (*MedianValues) Unmarshal

func (m *MedianValues) Unmarshal(dAtA []byte) error

func (*MedianValues) XXX_DiscardUnknown

func (m *MedianValues) XXX_DiscardUnknown()

func (*MedianValues) XXX_Marshal

func (m *MedianValues) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MedianValues) XXX_Merge

func (m *MedianValues) XXX_Merge(src proto.Message)

func (*MedianValues) XXX_Size

func (m *MedianValues) XXX_Size() int

func (*MedianValues) XXX_Unmarshal

func (m *MedianValues) XXX_Unmarshal(b []byte) error

type MedianValuesServiceClient

type MedianValuesServiceClient interface {
	// GetAllMedianValues returns the median values for all markets
	GetAllMedianValues(ctx context.Context, in *GetAllMedianValuesRequest, opts ...grpc.CallOption) (*GetAllMedianValuesResponse, error)
	// GetMedianValue returns the median value for a market given a query data that a market is associated with
	GetMedianValue(ctx context.Context, in *GetMedianValueRequest, opts ...grpc.CallOption) (*GetMedianValueResponse, error)
}

MedianValuesServiceClient is the client API for MedianValuesService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMedianValuesServiceClient

func NewMedianValuesServiceClient(cc grpc1.ClientConn) MedianValuesServiceClient

type MedianValuesServiceServer

type MedianValuesServiceServer interface {
	// GetAllMedianValues returns the median values for all markets
	GetAllMedianValues(context.Context, *GetAllMedianValuesRequest) (*GetAllMedianValuesResponse, error)
	// GetMedianValue returns the median value for a market given a query data that a market is associated with
	GetMedianValue(context.Context, *GetMedianValueRequest) (*GetMedianValueResponse, error)
}

MedianValuesServiceServer is the server API for MedianValuesService service.

type PriceFeedServiceClient

type PriceFeedServiceClient interface {
	// Updates market prices.
	UpdateMarketPrices(ctx context.Context, in *UpdateMarketPricesRequest, opts ...grpc.CallOption) (*UpdateMarketPricesResponse, error)
}

PriceFeedServiceClient is the client API for PriceFeedService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewPriceFeedServiceClient

func NewPriceFeedServiceClient(cc grpc1.ClientConn) PriceFeedServiceClient

type PriceFeedServiceServer

type PriceFeedServiceServer interface {
	// Updates market prices.
	UpdateMarketPrices(context.Context, *UpdateMarketPricesRequest) (*UpdateMarketPricesResponse, error)
}

PriceFeedServiceServer is the server API for PriceFeedService service.

type Stoppable

type Stoppable interface {
	Stop()
}

Stoppable is an interface for a service that can be stopped. This is used to stop services registered with the health monitor.

type TokenBridgeServiceClient

type TokenBridgeServiceClient interface {
	// GetPendingBridgeDeposit returns the oldest pending bridge deposit report data.
	GetPendingDepositReport(ctx context.Context, in *GetPendingDepositReportRequest, opts ...grpc.CallOption) (*GetPendingDepositReportResponse, error)
}

TokenBridgeServiceClient is the client API for TokenBridgeService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTokenBridgeServiceClient

func NewTokenBridgeServiceClient(cc grpc1.ClientConn) TokenBridgeServiceClient

type TokenBridgeServiceServer

type TokenBridgeServiceServer interface {
	// GetPendingBridgeDeposit returns the oldest pending bridge deposit report data.
	GetPendingDepositReport(context.Context, *GetPendingDepositReportRequest) (*GetPendingDepositReportResponse, error)
}

TokenBridgeServiceServer is the server API for TokenBridgeService service.

type UnimplementedMedianValuesServiceServer

type UnimplementedMedianValuesServiceServer struct {
}

UnimplementedMedianValuesServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedMedianValuesServiceServer) GetAllMedianValues

func (*UnimplementedMedianValuesServiceServer) GetMedianValue

type UnimplementedPriceFeedServiceServer

type UnimplementedPriceFeedServiceServer struct {
}

UnimplementedPriceFeedServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedPriceFeedServiceServer) UpdateMarketPrices

type UnimplementedTokenBridgeServiceServer

type UnimplementedTokenBridgeServiceServer struct {
}

UnimplementedTokenBridgeServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedTokenBridgeServiceServer) GetPendingDepositReport

type UpdateMarketPricesRequest

type UpdateMarketPricesRequest struct {
	MarketPriceUpdates []*MarketPriceUpdate `protobuf:"bytes,1,rep,name=market_price_updates,json=marketPriceUpdates,proto3" json:"market_price_updates,omitempty"`
}

UpdateMarketPriceRequest is a request message updating market prices.

func (*UpdateMarketPricesRequest) Descriptor

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

func (*UpdateMarketPricesRequest) GetMarketPriceUpdates

func (m *UpdateMarketPricesRequest) GetMarketPriceUpdates() []*MarketPriceUpdate

func (*UpdateMarketPricesRequest) Marshal

func (m *UpdateMarketPricesRequest) Marshal() (dAtA []byte, err error)

func (*UpdateMarketPricesRequest) MarshalTo

func (m *UpdateMarketPricesRequest) MarshalTo(dAtA []byte) (int, error)

func (*UpdateMarketPricesRequest) MarshalToSizedBuffer

func (m *UpdateMarketPricesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*UpdateMarketPricesRequest) ProtoMessage

func (*UpdateMarketPricesRequest) ProtoMessage()

func (*UpdateMarketPricesRequest) Reset

func (m *UpdateMarketPricesRequest) Reset()

func (*UpdateMarketPricesRequest) Size

func (m *UpdateMarketPricesRequest) Size() (n int)

func (*UpdateMarketPricesRequest) String

func (m *UpdateMarketPricesRequest) String() string

func (*UpdateMarketPricesRequest) Unmarshal

func (m *UpdateMarketPricesRequest) Unmarshal(dAtA []byte) error

func (*UpdateMarketPricesRequest) XXX_DiscardUnknown

func (m *UpdateMarketPricesRequest) XXX_DiscardUnknown()

func (*UpdateMarketPricesRequest) XXX_Marshal

func (m *UpdateMarketPricesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UpdateMarketPricesRequest) XXX_Merge

func (m *UpdateMarketPricesRequest) XXX_Merge(src proto.Message)

func (*UpdateMarketPricesRequest) XXX_Size

func (m *UpdateMarketPricesRequest) XXX_Size() int

func (*UpdateMarketPricesRequest) XXX_Unmarshal

func (m *UpdateMarketPricesRequest) XXX_Unmarshal(b []byte) error

type UpdateMarketPricesResponse

type UpdateMarketPricesResponse struct {
}

UpdateMarketPricesResponse is a response message for updating market prices.

func (*UpdateMarketPricesResponse) Descriptor

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

func (*UpdateMarketPricesResponse) Marshal

func (m *UpdateMarketPricesResponse) Marshal() (dAtA []byte, err error)

func (*UpdateMarketPricesResponse) MarshalTo

func (m *UpdateMarketPricesResponse) MarshalTo(dAtA []byte) (int, error)

func (*UpdateMarketPricesResponse) MarshalToSizedBuffer

func (m *UpdateMarketPricesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*UpdateMarketPricesResponse) ProtoMessage

func (*UpdateMarketPricesResponse) ProtoMessage()

func (*UpdateMarketPricesResponse) Reset

func (m *UpdateMarketPricesResponse) Reset()

func (*UpdateMarketPricesResponse) Size

func (m *UpdateMarketPricesResponse) Size() (n int)

func (*UpdateMarketPricesResponse) String

func (m *UpdateMarketPricesResponse) String() string

func (*UpdateMarketPricesResponse) Unmarshal

func (m *UpdateMarketPricesResponse) Unmarshal(dAtA []byte) error

func (*UpdateMarketPricesResponse) XXX_DiscardUnknown

func (m *UpdateMarketPricesResponse) XXX_DiscardUnknown()

func (*UpdateMarketPricesResponse) XXX_Marshal

func (m *UpdateMarketPricesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UpdateMarketPricesResponse) XXX_Merge

func (m *UpdateMarketPricesResponse) XXX_Merge(src proto.Message)

func (*UpdateMarketPricesResponse) XXX_Size

func (m *UpdateMarketPricesResponse) XXX_Size() int

func (*UpdateMarketPricesResponse) XXX_Unmarshal

func (m *UpdateMarketPricesResponse) XXX_Unmarshal(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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