admin

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2021 License: MIT Imports: 4 Imported by: 1

Documentation

Index

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) GCStaged

func (w *Data) GCStaged(ctx context.Context) (*proto.GCStagedResponse, error)

GCStaged unpins staged data not related to queued or executing jobs.

func (*Data) PinnedCids

func (w *Data) PinnedCids(ctx context.Context) (*proto.PinnedCidsResponse, error)

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

List lists StorageJobs according to the provided ListConfig.

func (*StorageJobs) Summary

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.

func (*Users) Create

func (p *Users) Create(ctx context.Context) (*adminPb.CreateUserResponse, error)

Create creates a new Powergate user, returning the user ID and auth token.

func (*Users) List

func (p *Users) List(ctx context.Context) (*adminPb.UsersResponse, error)

List returns a list of existing users.

type Wallet

type Wallet struct {
	// contains filtered or unexported fields
}

Wallet provides access to Powergate wallet admin APIs.

func (*Wallet) Addresses

func (w *Wallet) Addresses(ctx context.Context) (*adminPb.AddressesResponse, error)

Addresses lists all addresses associated with this Powergate.

func (*Wallet) NewAddress

func (w *Wallet) NewAddress(ctx context.Context, addrType string) (*adminPb.NewAddressResponse, error)

NewAddress creates a new address.

func (*Wallet) SendFil

func (w *Wallet) SendFil(ctx context.Context, from, to string, amount *big.Int) (*adminPb.SendFilResponse, error)

SendFil sends FIL from an address associated with this Powergate to any other address.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL