Documentation
¶
Index ¶
- Variables
- type Option
- type Publisher
- func NewPublisher(address string, lsys ipld.LinkSystem, privKey ic.PrivKey, options ...Option) (*Publisher, error)
- func NewPublisherForListener(listener net.Listener, handlerPath string, lsys ipld.LinkSystem, ...) (*Publisher, error)
- func NewPublisherWithoutServer(address, handlerPath string, lsys ipld.LinkSystem, privKey ic.PrivKey, ...) (*Publisher, error)
- type Sync
- type Syncer
Constants ¶
This section is empty.
Variables ¶
var IpniPath = path.Join("/ipni", protoVersion, "ad")
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*config) error
Option is a function that sets a value in a config.
func WithHandlerPath ¶
WithHandlerPath sets the path used to handle requests to this publisher. This should only include the path before the /ipni/v1/ad/ part of the path.
func WithHeadTopic ¶
WithHeadTopic sets the optional topic returned in a head query response. This is the topic on which advertisement are announced.
func WithServer ¶
WithServer, if true, starts an http server listening on the given address. an HTTP server. If this option is not specified, then no server is started and this will need to be done by the caller.
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
Publisher serves an advertisement chain over HTTP.
func NewPublisher ¶
func NewPublisher(address string, lsys ipld.LinkSystem, privKey ic.PrivKey, options ...Option) (*Publisher, error)
NewPublisher creates a new http publisher. It is optional with start a server, listening on the specified address, using the WithStartServer option.
func NewPublisherForListener ¶
func NewPublisherForListener(listener net.Listener, handlerPath string, lsys ipld.LinkSystem, privKey ic.PrivKey) (*Publisher, error)
NewPublisherForListener creates a new http publisher for an existing listener. When providing an existing listener, running the HTTP server is the caller's responsibility. ServeHTTP on the returned Publisher can be used to handle requests. handlerPath is the path to handle requests on, e.g. "ipni" for `/ipni/...` requests.
DEPRECATED: use NewPublisherWithoutServer(listener.Addr(), ...)
func NewPublisherWithoutServer ¶
func NewPublisherWithoutServer(address, handlerPath string, lsys ipld.LinkSystem, privKey ic.PrivKey, options ...Option) (*Publisher, error)
NewPublisherWithoutServer creates a new http publisher for an existing network address. When providing an existing network address, running the HTTP server is the caller's responsibility. ServeHTTP on the returned Publisher can be used to handle requests.
DEPRECATED: use NewPublisher(address, lsys, privKey, WithHandlerPath(handlerPath))
func (*Publisher) Addrs ¶
Addrs returns the addresses, as []multiaddress, that the Publisher is listening on.
func (*Publisher) Protocol ¶
Protocol returns the multihash protocol ID of the transport used by the publisher.
type Sync ¶
type Sync struct {
// contains filtered or unexported fields
}
Sync provides sync functionality for use with all http syncs.