Documentation ¶
Index ¶
- func QueryRootCid(ctx context.Context, host host.Host, topic string, peerID peer.ID) (cid.Cid, error)
- type Publisher
- func (p *Publisher) Close() error
- func (p *Publisher) Root() cid.Cid
- func (p *Publisher) Serve(host host.Host, topic string) error
- func (p *Publisher) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (p *Publisher) ServePrevious(host host.Host, topic string) error
- func (p *Publisher) SetRoot(c cid.Cid)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QueryRootCid ¶
func QueryRootCid(ctx context.Context, host host.Host, topic string, peerID peer.ID) (cid.Cid, error)
QueryRootCid queries a server, identified by peerID, for the root (most recent) CID. If the server does not support the current protocol ID, then an attempt is made to connect to the server using the previous protocol ID.
Types ¶
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
func (*Publisher) Root ¶
func (p *Publisher) Root() cid.Cid
Root returns the current root being publisher.
func (*Publisher) Serve ¶
Serve starts the server using the protocol ID derived from the topic name.
func (*Publisher) ServeHTTP ¶
func (p *Publisher) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP satisfies the http.Handler interface.
func (*Publisher) ServePrevious ¶
ServePrevious starts the server using the previous protocol ID derived from the topic name. This is used for testing, or for cases where it is necessary to support clients that do not surrort the current protocol ID>
Click to show internal directories.
Click to hide internal directories.