Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client[I, R]) CancelSink(url string) error
- func (c *Client[I, R]) CancelSource(url string) error
- func (c *Client[I, R]) GetSinkSession(url string) *core.SinkSession[I, batch.BatchState]
- func (c *Client[I, R]) GetSourceSession(url string) *core.SourceSession[I, batch.BatchState]
- func (c *Client[I, R]) Receive(url string, id I) error
- func (c *Client[I, R]) Send(url string, id I) error
- func (c *Client[I, R]) SinkInfo(url string) (*core.SinkSessionInfo[batch.BatchState], error)
- func (c *Client[I, R]) SinkSessions() []string
- func (c *Client[I, R]) SourceInfo(url string) (*core.SourceSessionInfo[batch.BatchState], error)
- func (c *Client[I, R]) SourceSessions() []string
- type Config
- type HttpClientSinkConnection
- type HttpClientSourceConnection
- type RequestBatchBlockSender
- type RequestStatusSender
- type ResponseBatchBlockSender
- type ResponseStatusSender
- type Server
- func (srv *Server[I, R]) HandleBlocks(response http.ResponseWriter, request *http.Request)
- func (srv *Server[I, R]) HandleStatus(response http.ResponseWriter, request *http.Request)
- func (srv *Server[I, R]) SinkInfo(token batch.SessionId) (*core.SinkSessionInfo[batch.BatchState], error)
- func (srv *Server[I, R]) SinkSessions() []batch.SessionId
- func (srv *Server[I, R]) SourceInfo(token batch.SessionId) (*core.SourceSessionInfo[batch.BatchState], error)
- func (srv *Server[I, R]) SourceSessions() []batch.SessionId
- func (srv *Server[I, R]) Start() error
- func (srv *Server[I, R]) Stop() error
Constants ¶
View Source
const CONTENT_TYPE_CBOR = "application/cbor"
Variables ¶
View Source
var ( ErrInvalidSession = errors.New("invalid session") ErrInvalidResponse = errors.New("invalid http response") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client[I core.BlockId, R core.BlockIdRef[I]] struct { // contains filtered or unexported fields }
func NewClient ¶
func NewClient[I core.BlockId, R core.BlockIdRef[I]](store core.BlockStore[I], config batch.Config) *Client[I, R]
func (*Client[I, R]) CancelSink ¶
CancelSink cancels the sink session with the given URL.
func (*Client[I, R]) CancelSource ¶
CancelSource cancels the source session with the given URL.
func (*Client[I, R]) GetSinkSession ¶
func (c *Client[I, R]) GetSinkSession(url string) *core.SinkSession[I, batch.BatchState]
func (*Client[I, R]) GetSourceSession ¶
func (c *Client[I, R]) GetSourceSession(url string) *core.SourceSession[I, batch.BatchState]
func (*Client[I, R]) SinkInfo ¶
func (c *Client[I, R]) SinkInfo(url string) (*core.SinkSessionInfo[batch.BatchState], error)
func (*Client[I, R]) SinkSessions ¶
func (*Client[I, R]) SourceInfo ¶
func (c *Client[I, R]) SourceInfo(url string) (*core.SourceSessionInfo[batch.BatchState], error)
func (*Client[I, R]) SourceSessions ¶
type Config ¶
type Config struct {
Address string
}
func DefaultConfig ¶
func DefaultConfig() Config
type HttpClientSinkConnection ¶
type HttpClientSinkConnection[I core.BlockId, R core.BlockIdRef[I]] struct { *batch.GenericBatchSinkConnection[I, R] // contains filtered or unexported fields }
func NewHttpClientSinkConnection ¶
func NewHttpClientSinkConnection[I core.BlockId, R core.BlockIdRef[I]](client *http.Client, url string, stats stats.Stats, instrument instrumented.InstrumentationOptions, maxBlocksPerRound uint32) *HttpClientSinkConnection[I, R]
func (*HttpClientSinkConnection[I, R]) ImmediateSender ¶
func (conn *HttpClientSinkConnection[I, R]) ImmediateSender(session *core.SinkSession[I, batch.BatchState]) core.StatusSender[I]
type HttpClientSourceConnection ¶
type HttpClientSourceConnection[I core.BlockId, R core.BlockIdRef[I]] struct { *batch.GenericBatchSourceConnection[I, R] // contains filtered or unexported fields }
func NewHttpClientSourceConnection ¶
func NewHttpClientSourceConnection[I core.BlockId, R core.BlockIdRef[I]](client *http.Client, url string, stats stats.Stats, instrument instrumented.InstrumentationOptions, maxBlocksPerRound uint32, maxBlocksPerColdCall uint32) *HttpClientSourceConnection[I, R]
func (*HttpClientSourceConnection[I, R]) ImmediateSender ¶
func (conn *HttpClientSourceConnection[I, R]) ImmediateSender(session *core.SourceSession[I, batch.BatchState], maxBlocksPerRound uint32) core.BlockSender[I]
type RequestBatchBlockSender ¶
type RequestBatchBlockSender[I core.BlockId, R core.BlockIdRef[I]] struct { // contains filtered or unexported fields }
func (*RequestBatchBlockSender[I, R]) Close ¶
func (bbs *RequestBatchBlockSender[I, R]) Close() error
type RequestStatusSender ¶
type RequestStatusSender[I core.BlockId, R core.BlockIdRef[I]] struct { // contains filtered or unexported fields }
func (*RequestStatusSender[I, R]) Close ¶
func (ss *RequestStatusSender[I, R]) Close() error
func (*RequestStatusSender[I, R]) SendStatus ¶
func (ss *RequestStatusSender[I, R]) SendStatus(have filter.Filter[I], want []I) error
type ResponseBatchBlockSender ¶
type ResponseBatchBlockSender[I core.BlockId, R core.BlockIdRef[I]] struct { // contains filtered or unexported fields }
func (*ResponseBatchBlockSender[I, R]) Close ¶
func (bbs *ResponseBatchBlockSender[I, R]) Close() error
type ResponseStatusSender ¶
type ResponseStatusSender[I core.BlockId, R core.BlockIdRef[I]] struct { // contains filtered or unexported fields }
func (*ResponseStatusSender[I, R]) Close ¶
func (ss *ResponseStatusSender[I, R]) Close() error
func (*ResponseStatusSender[I, R]) SendStatus ¶
func (ss *ResponseStatusSender[I, R]) SendStatus(have filter.Filter[I], want []I) error
type Server ¶
type Server[I core.BlockId, R core.BlockIdRef[I]] struct { // contains filtered or unexported fields }
func NewServer ¶
func NewServer[I core.BlockId, R core.BlockIdRef[I]](store core.BlockStore[I], serverConfig Config, responderConfig batch.Config) *Server[I, R]
TODO: change config to something more flexible, so it can work for responder and this server. We have server config and responder config, and they are different. Start with 2 configs I guess
func (*Server[I, R]) HandleBlocks ¶
func (srv *Server[I, R]) HandleBlocks(response http.ResponseWriter, request *http.Request)
func (*Server[I, R]) HandleStatus ¶
func (srv *Server[I, R]) HandleStatus(response http.ResponseWriter, request *http.Request)
func (*Server[I, R]) SinkInfo ¶
func (srv *Server[I, R]) SinkInfo(token batch.SessionId) (*core.SinkSessionInfo[batch.BatchState], error)
func (*Server[I, R]) SinkSessions ¶
func (*Server[I, R]) SourceInfo ¶
func (srv *Server[I, R]) SourceInfo(token batch.SessionId) (*core.SourceSessionInfo[batch.BatchState], error)
func (*Server[I, R]) SourceSessions ¶
Click to show internal directories.
Click to hide internal directories.