Documentation ¶
Overview ¶
Package adminserver provides a HTTP server that allows to perform administrative operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnnounceRes ¶
type AnnounceRes struct {
// The CID of the advertisement announced as latest.
AdvId cid.Cid `json:"adv_id"`
}
type ConnectReq ¶
type ConnectReq struct {
Maddr string `json:"maddr"`
}
ConnectReq request to connect to a given multiaddr.
type ConnectRes ¶
type ConnectRes struct { }
ConnectRes represents successful response to ConnectReq request.
type ImportCarReq ¶
type ImportCarReq struct { // The path to the CAR file Path string `json:"path"` // The optional key associated to the CAR. If not provided, one will be generated. Key []byte `json:"key"` // The optional metadata. Metadata []byte `json:"metadata"` }
ImportCarReq represents a request for importing a CAR file.
type ImportCarRes ¶
type ImportCarRes struct { // The lookup Key associated to the imported CAR. Key []byte `json:"key"` // The CID of the advertisement generated as a result of import. AdvId cid.Cid `json:"adv_id"` }
ImportCarRes represents the response to an ImportCarReq.
type ListCarRes ¶
type ListCarRes struct { // The path of CARs imported. Paths []string `json:"paths"` }
ListCarRes represents the response to list cars.
type Option ¶
type Option func(*options) error
Option captures a configurable parameter in admin HTTP server.
func WithListenAddr ¶
WithListenAddr sets the net address on which the admin HTTP server is exposed. If uset, the default address of '0.0.0.0:3102' is used.
func WithReadTimeout ¶
WithReadTimeout set s the HTTP read timeout. If unset, the default of 30 seconds is used.
func WithWriteTimeout ¶
WithWriteTimeout set s the HTTP write timeout. If unset, the default of 30 seconds is used.
type RemoveCarReq ¶
type RemoveCarReq struct { // The key associated to the CAR. Key []byte `json:"key"` }
RemoveCarReq represents a request for removing a CAR file.
type RemoveCarRes ¶
type RemoveCarRes struct {
// The CID of the advertisement generated as a result of removal.
AdvId cid.Cid `json:"adv_id"`
}
RemoveCarRes represents the response to a RemoveCarReq