Documentation ¶
Index ¶
- type Admin
- type Data
- type ListConfig
- type ListSelect
- type StorageInfo
- type StorageJobs
- type SummaryOption
- type Users
- type Wallet
- func (w *Wallet) Addresses(ctx context.Context) (*adminPb.AddressesResponse, error)
- func (w *Wallet) NewAddress(ctx context.Context, addrType string) (*adminPb.NewAddressResponse, error)
- func (w *Wallet) SendFil(ctx context.Context, from, to string, amount *big.Int) (*adminPb.SendFilResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Admin ¶
type Admin struct { StorageJobs *StorageJobs StorageInfo *StorageInfo Users *Users Wallet *Wallet Data *Data }
Admin provides access to Powergate admin APIs.
func NewAdmin ¶
func NewAdmin(client adminPb.AdminServiceClient) *Admin
NewAdmin creates a new admin API.
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
Data provides access to Powergate data admin APIs.
func (*Data) PinnedCids ¶
PinnedCids returns pinned cids information of hot-storage.
type ListConfig ¶
type ListConfig struct { // UserIDFilter filters StorageJobs list to the specified user ID. Defaults to no filter. UserIDFilter string // CidFilter filters StorageJobs list to the specified cid. Defaults to no filter. CidFilter string // Limit limits the number of StorageJobs returned. Defaults to no limit. Limit uint64 // Ascending returns the StorageJobs ascending by time. Defaults to false, descending. Ascending bool // Select specifies to return StorageJobs in the specified state. Select ListSelect // NextPageToken sets the slug from which to start building the next page of results. NextPageToken string }
ListConfig controls the behavior for listing StorageJobs.
type ListSelect ¶
type ListSelect int32
ListSelect specifies which StorageJobs to list.
const ( // All lists all StorageJobs and is the default. All ListSelect = iota // Queued lists queued StorageJobs. Queued // Executing lists executing StorageJobs. Executing // Final lists final StorageJobs. Final )
type StorageInfo ¶
type StorageInfo struct {
// contains filtered or unexported fields
}
StorageInfo provides access to Powergate storage indo APIs.
func (*StorageInfo) Get ¶
func (s *StorageInfo) Get(ctx context.Context, userID, cid string) (*adminPb.StorageInfoResponse, error)
Get returns the information about a stored Cid. If no information is available, since the Cid was never stored, it returns an error with codes.NotFound.
func (*StorageInfo) List ¶
func (s *StorageInfo) List(ctx context.Context, userIDs, cids []string) (*adminPb.ListStorageInfoResponse, error)
List returns a list of information about all stored cids, filtered by user ids and cids if provided.
type StorageJobs ¶
type StorageJobs struct {
// contains filtered or unexported fields
}
StorageJobs provides access to Powergate jobs admin APIs.
func (*StorageJobs) List ¶
func (j *StorageJobs) List(ctx context.Context, config ListConfig) (*adminPb.ListStorageJobsResponse, error)
List lists StorageJobs according to the provided ListConfig.
func (*StorageJobs) Summary ¶
func (j *StorageJobs) Summary(ctx context.Context, opts ...SummaryOption) (*adminPb.StorageJobsSummaryResponse, error)
Summary returns a summary of storage jobs.
type SummaryOption ¶
type SummaryOption = func(*summaryConfig)
SummaryOption configures a storageJobsConfig.
func WithCid ¶
func WithCid(cid string) SummaryOption
WithCid filters the results to the specified data cid.
func WithUserID ¶
func WithUserID(userID string) SummaryOption
WithUserID filters the results to the specified user.
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
Users provides access to Powergate admin users APIs.
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
Wallet provides access to Powergate wallet admin APIs.
func (*Wallet) NewAddress ¶
func (w *Wallet) NewAddress(ctx context.Context, addrType string) (*adminPb.NewAddressResponse, error)
NewAddress creates a new address.