Documentation ¶
Index ¶
- Constants
- func CreateClientConn(target string, optsOverrides ...grpc.DialOption) (*grpc.ClientConn, error)
- type Asks
- type Client
- type FFS
- func (f *FFS) Addrs(ctx context.Context) ([]api.AddrInfo, error)
- func (f *FFS) CancelJob(ctx context.Context, jid ffs.JobID) error
- func (f *FFS) Create(ctx context.Context) (string, string, error)
- func (f *FFS) CreatePayChannel(ctx context.Context, from string, to string, amount uint64) (ffs.PaychInfo, cid.Cid, error)
- func (f *FFS) DefaultStorageConfig(ctx context.Context) (ffs.StorageConfig, error)
- func (f *FFS) Get(ctx context.Context, c cid.Cid) (io.Reader, error)
- func (f *FFS) GetFolder(ctx context.Context, ipfsRevProxyAddr string, c cid.Cid, outputDir string) error
- func (f *FFS) GetStorageConfig(ctx context.Context, c cid.Cid) (*rpc.GetStorageConfigResponse, error)
- func (f *FFS) GetStorageJob(ctx context.Context, jid ffs.JobID) (ffs.StorageJob, error)
- func (f *FFS) ID(ctx context.Context) (ffs.APIID, error)
- func (f *FFS) Info(ctx context.Context) (api.InstanceInfo, error)
- func (f *FFS) ListAPI(ctx context.Context) ([]ffs.APIID, error)
- func (f *FFS) ListPayChannels(ctx context.Context) ([]ffs.PaychInfo, error)
- func (f *FFS) ListRetrievalDealRecords(ctx context.Context, opts ...ListDealRecordsOption) ([]deals.RetrievalDealRecord, error)
- func (f *FFS) ListStorageDealRecords(ctx context.Context, opts ...ListDealRecordsOption) ([]deals.StorageDealRecord, error)
- func (f *FFS) NewAddr(ctx context.Context, name string, options ...NewAddressOption) (string, error)
- func (f *FFS) PushStorageConfig(ctx context.Context, c cid.Cid, opts ...PushStorageConfigOption) (ffs.JobID, error)
- func (f *FFS) RedeemPayChannel(ctx context.Context, addr string) error
- func (f *FFS) Remove(ctx context.Context, c cid.Cid) error
- func (f *FFS) Replace(ctx context.Context, c1 cid.Cid, c2 cid.Cid) (ffs.JobID, error)
- func (f *FFS) SendFil(ctx context.Context, from string, to string, amount int64) error
- func (f *FFS) SetDefaultStorageConfig(ctx context.Context, config ffs.StorageConfig) error
- func (f *FFS) Show(ctx context.Context, c cid.Cid) (*rpc.ShowResponse, error)
- func (f *FFS) Stage(ctx context.Context, data io.Reader) (*cid.Cid, error)
- func (f *FFS) StageFolder(ctx context.Context, ipfsRevProxyAddr string, folderPath string) (cid.Cid, error)
- func (f *FFS) WatchJobs(ctx context.Context, ch chan<- JobEvent, jids ...ffs.JobID) error
- func (f *FFS) WatchLogs(ctx context.Context, ch chan<- LogEvent, c cid.Cid, opts ...WatchLogsOption) error
- type Faults
- type Health
- type JobEvent
- type ListDealRecordsOption
- func WithAscending(ascending bool) ListDealRecordsOption
- func WithDataCids(cids ...string) ListDealRecordsOption
- func WithFromAddrs(addrs ...string) ListDealRecordsOption
- func WithIncludeFinal(includeFinal bool) ListDealRecordsOption
- func WithIncludePending(includePending bool) ListDealRecordsOption
- type LogEvent
- type Miners
- type Net
- func (net *Net) ConnectPeer(ctx context.Context, addrInfo peer.AddrInfo) error
- func (net *Net) Connectedness(ctx context.Context, peerID peer.ID) (n.Connectedness, error)
- func (net *Net) DisconnectPeer(ctx context.Context, peerID peer.ID) error
- func (net *Net) FindPeer(ctx context.Context, peerID peer.ID) (n.PeerInfo, error)
- func (net *Net) ListenAddr(ctx context.Context) (peer.AddrInfo, error)
- func (net *Net) Peers(ctx context.Context) ([]n.PeerInfo, error)
- type NewAddressOption
- type PushStorageConfigOption
- type Reputation
- type TokenAuth
- type Wallet
- type WatchLogsOption
Constants ¶
const AuthKey = ctxKey("ffstoken")
AuthKey is the key that should be used to set the auth token in a Context.
Variables ¶
This section is empty.
Functions ¶
func CreateClientConn ¶ added in v0.3.0
func CreateClientConn(target string, optsOverrides ...grpc.DialOption) (*grpc.ClientConn, error)
CreateClientConn creates a gRPC connection with sensible defaults and the provided overrides.
Types ¶
type Asks ¶
type Asks struct {
// contains filtered or unexported fields
}
Asks provides an API for viewing asks data.
type Client ¶
type Client struct { Asks *Asks Miners *Miners Faults *Faults Wallet *Wallet Reputation *Reputation FFS *FFS Health *Health Net *Net // contains filtered or unexported fields }
Client provides the client api.
func NewClient ¶
func NewClient(host string, optsOverrides ...grpc.DialOption) (*Client, error)
NewClient creates a client.
func (*Client) BuildInfo ¶ added in v0.4.0
func (c *Client) BuildInfo(ctx context.Context) (*buildinfoRpc.BuildInfoResponse, error)
BuildInfo returns build info about the server.
type FFS ¶
type FFS struct {
// contains filtered or unexported fields
}
FFS provides the API to create and interact with an FFS instance.
func (*FFS) CreatePayChannel ¶
func (f *FFS) CreatePayChannel(ctx context.Context, from string, to string, amount uint64) (ffs.PaychInfo, cid.Cid, error)
CreatePayChannel creates a new payment channel.
func (*FFS) DefaultStorageConfig ¶ added in v0.2.0
DefaultStorageConfig returns the default storage config.
func (*FFS) GetFolder ¶ added in v0.4.0
func (f *FFS) GetFolder(ctx context.Context, ipfsRevProxyAddr string, c cid.Cid, outputDir string) error
GetFolder retrieves to outputDir a Cid which corresponds to a folder.
func (*FFS) GetStorageConfig ¶ added in v0.2.0
func (f *FFS) GetStorageConfig(ctx context.Context, c cid.Cid) (*rpc.GetStorageConfigResponse, error)
GetStorageConfig gets the current config for a cid.
func (*FFS) GetStorageJob ¶ added in v0.6.0
GetStorageJob returns the current state of the specified job.
func (*FFS) ListPayChannels ¶
ListPayChannels returns a list of payment channels.
func (*FFS) ListRetrievalDealRecords ¶
func (f *FFS) ListRetrievalDealRecords(ctx context.Context, opts ...ListDealRecordsOption) ([]deals.RetrievalDealRecord, error)
ListRetrievalDealRecords returns a list of retrieval deals for the FFS instance according to the provided options.
func (*FFS) ListStorageDealRecords ¶
func (f *FFS) ListStorageDealRecords(ctx context.Context, opts ...ListDealRecordsOption) ([]deals.StorageDealRecord, error)
ListStorageDealRecords returns a list of storage deals for the FFS instance according to the provided options.
func (*FFS) NewAddr ¶
func (f *FFS) NewAddr(ctx context.Context, name string, options ...NewAddressOption) (string, error)
NewAddr created a new wallet address managed by the FFS instance.
func (*FFS) PushStorageConfig ¶ added in v0.2.0
func (f *FFS) PushStorageConfig(ctx context.Context, c cid.Cid, opts ...PushStorageConfigOption) (ffs.JobID, error)
PushStorageConfig push a new configuration for the Cid in the Hot and Cold layers.
func (*FFS) RedeemPayChannel ¶
RedeemPayChannel redeems a payment channel.
func (*FFS) Remove ¶
Remove removes a Cid from being tracked as an active storage. The Cid should have both Hot and Cold storage disabled, if that isn't the case it will return ErrActiveInStorage.
func (*FFS) Replace ¶
Replace pushes a StorageConfig for c2 equal to that of c1, and removes c1. This operation is more efficient than manually removing and adding in two separate operations.
func (*FFS) SendFil ¶
SendFil sends fil from a managed address to any another address, returns immediately but funds are sent asynchronously.
func (*FFS) SetDefaultStorageConfig ¶ added in v0.2.0
SetDefaultStorageConfig sets the default storage config.
func (*FFS) Stage ¶ added in v0.2.0
Stage allows to temporarily stage data in the Hot Storage in preparation for pushing a cid storage config.
func (*FFS) StageFolder ¶ added in v0.4.0
func (f *FFS) StageFolder(ctx context.Context, ipfsRevProxyAddr string, folderPath string) (cid.Cid, error)
StageFolder allows to temporarily stage a folder in the Hot Storage in preparation for pushing a cid storage config.
func (*FFS) WatchJobs ¶
WatchJobs pushes JobEvents to the provided channel. The provided channel will be owned by the client after the call, so it shouldn't be closed by the client. To stop receiving events, the provided ctx should be canceled. If an error occurs, it will be returned in the Err field of JobEvent and the channel will be closed.
func (*FFS) WatchLogs ¶
func (f *FFS) WatchLogs(ctx context.Context, ch chan<- LogEvent, c cid.Cid, opts ...WatchLogsOption) error
WatchLogs pushes human-friendly messages about Cid executions. The method is blocking and will continue to send messages until the context is canceled. The provided channel is owned by the method and must not be closed.
type Faults ¶
type Faults struct {
// contains filtered or unexported fields
}
Faults provides an API for viewing faults data.
type Health ¶
type Health struct {
// contains filtered or unexported fields
}
Health provides an API for checking node Health.
type JobEvent ¶
type JobEvent struct { Job ffs.StorageJob Err error }
JobEvent represents an event for Watching a job.
type ListDealRecordsOption ¶
type ListDealRecordsOption func(*rpc.ListDealRecordsConfig)
ListDealRecordsOption updates a ListDealRecordsConfig.
func WithAscending ¶
func WithAscending(ascending bool) ListDealRecordsOption
WithAscending specifies to sort the results in ascending order. Default is descending order. Records are sorted by timestamp.
func WithDataCids ¶
func WithDataCids(cids ...string) ListDealRecordsOption
WithDataCids limits the results to deals for the provided data cids. If WithFromAddrs is also provided, this is an AND operation.
func WithFromAddrs ¶
func WithFromAddrs(addrs ...string) ListDealRecordsOption
WithFromAddrs limits the results deals initiated from the provided wallet addresses. If WithDataCids is also provided, this is an AND operation.
func WithIncludeFinal ¶
func WithIncludeFinal(includeFinal bool) ListDealRecordsOption
WithIncludeFinal specifies whether or not to include final deals in the results. Default is false. Ignored for ListRetrievalDealRecords.
func WithIncludePending ¶
func WithIncludePending(includePending bool) ListDealRecordsOption
WithIncludePending specifies whether or not to include pending deals in the results. Default is false. Ignored for ListRetrievalDealRecords.
type Miners ¶
type Miners struct {
// contains filtered or unexported fields
}
Miners provides an API for viewing miner data.
type Net ¶
type Net struct {
// contains filtered or unexported fields
}
Net provides the Net API.
func (*Net) ConnectPeer ¶
ConnectPeer connects to a peer.
func (*Net) Connectedness ¶
Connectedness returns the connection status to a peer.
func (*Net) DisconnectPeer ¶
DisconnectPeer disconnects from a peer.
func (*Net) ListenAddr ¶
ListenAddr returns listener address info for the local node.
type NewAddressOption ¶
type NewAddressOption func(r *rpc.NewAddrRequest)
NewAddressOption is a function that changes a NewAddressConfig.
func WithAddressType ¶
func WithAddressType(addressType string) NewAddressOption
WithAddressType specifies the type of address to create.
func WithMakeDefault ¶
func WithMakeDefault(makeDefault bool) NewAddressOption
WithMakeDefault specifies if the new address should become the default.
type PushStorageConfigOption ¶ added in v0.2.0
type PushStorageConfigOption func(r *rpc.PushStorageConfigRequest)
PushStorageConfigOption mutates a push request.
func WithOverride ¶
func WithOverride(override bool) PushStorageConfigOption
WithOverride allows a new push configuration to override an existing one. It's used as an extra security measure to avoid unwanted configuration changes.
func WithStorageConfig ¶ added in v0.2.0
func WithStorageConfig(c ffs.StorageConfig) PushStorageConfigOption
WithStorageConfig overrides the Api default Cid configuration.
type Reputation ¶
type Reputation struct {
// contains filtered or unexported fields
}
Reputation provides an API for viewing reputation data.
func (*Reputation) AddSource ¶
AddSource adds a new external Source to be considered for reputation generation.
func (*Reputation) GetTopMiners ¶
func (r *Reputation) GetTopMiners(ctx context.Context, limit int) ([]reputation.MinerScore, error)
GetTopMiners gets the top n miners with best score.
type TokenAuth ¶
type TokenAuth struct {
Secure bool
}
TokenAuth provides token based auth.
func (TokenAuth) GetRequestMetadata ¶
GetRequestMetadata returns request metadata that includes the auth token.
func (TokenAuth) RequireTransportSecurity ¶
RequireTransportSecurity specifies if the connection should be secure.
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
Wallet provides an API for managing filecoin wallets.
func (*Wallet) NewAddress ¶ added in v0.1.1
NewAddress creates a new filecoin address [bls|secp256k1].
type WatchLogsOption ¶
type WatchLogsOption func(r *rpc.WatchLogsRequest)
WatchLogsOption is a function that changes GetLogsConfig.
func WithHistory ¶
func WithHistory(enabled bool) WatchLogsOption
WithHistory indicates that prior history logs should be sent in the channel before getting real time logs.
func WithJidFilter ¶
func WithJidFilter(jid ffs.JobID) WatchLogsOption
WithJidFilter filters only log messages of a Cid related to the Job with id jid.