head

package
v0.5.19 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0, MIT Imports: 16 Imported by: 0

Documentation

Index

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 NewPublisher

func NewPublisher() *Publisher

NewPublisher creates a new head publisher.

func (*Publisher) Close

func (p *Publisher) Close() error

Close stops the server.

func (*Publisher) Root

func (p *Publisher) Root() cid.Cid

Root returns the current root being publisher.

func (*Publisher) Serve

func (p *Publisher) Serve(host host.Host, topic string) error

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

func (p *Publisher) ServePrevious(host host.Host, topic string) error

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>

func (*Publisher) SetRoot

func (p *Publisher) SetRoot(c cid.Cid)

SetRoot sets the CID being published.

Jump to

Keyboard shortcuts

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