Documentation
¶
Index ¶
- Constants
- func StreamCar(ctx context.Context, requestLsys linking.LinkSystem, out io.Writer, ...) error
- type ErrorLogger
- type FrisbiiServer
- type HttpIpfs
- type HttpOption
- type IndexerProvider
- type LogMiddleware
- type LoggingResponseWriter
- func (w *LoggingResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (w *LoggingResponseWriter) Log(status int, duration time.Duration, bytes int, msg string)
- func (w *LoggingResponseWriter) LogError(status int, err error)
- func (w *LoggingResponseWriter) Write(b []byte) (int, error)
- func (w *LoggingResponseWriter) WriteHeader(status int)
- type MultiReadableStorage
- func (m *MultiReadableStorage) AddStore(store storage.StreamingReadableStorage, roots []cid.Cid)
- func (m *MultiReadableStorage) Get(ctx context.Context, key string) ([]byte, error)
- func (m *MultiReadableStorage) GetStream(ctx context.Context, key string) (io.ReadCloser, error)
- func (m *MultiReadableStorage) Has(ctx context.Context, key string) (bool, error)
- func (m *MultiReadableStorage) RootsLister() provider.MultihashLister
Constants ¶
const ContextID = "frisbii"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorLogger ¶
type FrisbiiServer ¶
type FrisbiiServer struct {
// contains filtered or unexported fields
}
FrisbiiServer is the main server for the frisbii application, it starts an HTTP server to serve data according to the Trustless Gateway spec and it also provides a mechanism to announce the server to the indexer service.
func NewFrisbiiServer ¶
func NewFrisbiiServer( ctx context.Context, logWriter io.Writer, lsys linking.LinkSystem, address string, httpOptions ...HttpOption, ) (*FrisbiiServer, error)
func (*FrisbiiServer) Addr ¶
func (fs *FrisbiiServer) Addr() net.Addr
func (*FrisbiiServer) Announce ¶
func (fs *FrisbiiServer) Announce() error
func (*FrisbiiServer) Serve ¶
func (fs *FrisbiiServer) Serve() error
func (*FrisbiiServer) SetIndexerProvider ¶
func (fs *FrisbiiServer) SetIndexerProvider(handlerPath string, indexerProvider IndexerProvider) error
type HttpIpfs ¶
type HttpIpfs struct {
// contains filtered or unexported fields
}
HttpIpfs is an http.Handler that serves IPLD data via HTTP according to the Trustless Gateway specification.
func NewHttpIpfs ¶
func NewHttpIpfs( ctx context.Context, lsys linking.LinkSystem, opts ...HttpOption, ) *HttpIpfs
type HttpOption ¶ added in v0.1.0
type HttpOption func(*httpOptions)
func WithMaxResponseBytes ¶ added in v0.1.0
func WithMaxResponseBytes(b int64) HttpOption
WithMaxResponseBytes sets the maximum number of bytes that will be streamed before the connection is closed. This allows a server to limit the amount of data a client can request; and also restricts the ability to serve very large DAGs.
A value of 0 will disable the limitation. This is the default.
func WithMaxResponseDuration ¶ added in v0.1.0
func WithMaxResponseDuration(d time.Duration) HttpOption
WithMaxResponseDuration sets the maximum duration for a response to be streamed before the connection is closed. This allows a server to limit the amount of time a client can hold a connection open; and also restricts the ability to serve very large DAGs.
A value of 0 will disable the limitation. This is the default.
type IndexerProvider ¶
type LogMiddleware ¶
type LogMiddleware struct {
// contains filtered or unexported fields
}
LogMiddlware is a middleware that logs requests to the given io.Writer. it wraps requests in a LoggingResponseWriter that can be used to log standardised messages to the writer.
func NewLogMiddleware ¶
func NewLogMiddleware(next http.Handler, logWriter io.Writer) *LogMiddleware
func (*LogMiddleware) ServeHTTP ¶
func (lm *LogMiddleware) ServeHTTP(res http.ResponseWriter, req *http.Request)
type LoggingResponseWriter ¶
type LoggingResponseWriter struct {
http.ResponseWriter
// contains filtered or unexported fields
}
func NewLoggingResponseWriter ¶
func NewLoggingResponseWriter(w http.ResponseWriter, req *http.Request, logWriter io.Writer) *LoggingResponseWriter
func (*LoggingResponseWriter) Hijack ¶
func (w *LoggingResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
func (*LoggingResponseWriter) LogError ¶
func (w *LoggingResponseWriter) LogError(status int, err error)
func (*LoggingResponseWriter) WriteHeader ¶
func (w *LoggingResponseWriter) WriteHeader(status int)
type MultiReadableStorage ¶
type MultiReadableStorage struct {
// contains filtered or unexported fields
}
MultiReadableStorage manages a list of storage.StreamingReadableStorage stores, providing a unified LinkSystem interface to them.
func NewMultiReadableStorage ¶
func NewMultiReadableStorage() *MultiReadableStorage
func (*MultiReadableStorage) AddStore ¶
func (m *MultiReadableStorage) AddStore(store storage.StreamingReadableStorage, roots []cid.Cid)
func (*MultiReadableStorage) GetStream ¶
func (m *MultiReadableStorage) GetStream(ctx context.Context, key string) (io.ReadCloser, error)
func (*MultiReadableStorage) RootsLister ¶
func (m *MultiReadableStorage) RootsLister() provider.MultihashLister