operators

package
v1.89.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MaxOperatorsOnPage = 5

MaxOperatorsOnPage defines maximum limit on operators page.

Variables

View Source
var (

	// Error is an error class for operators service error.
	Error = errs.Class("operators")
)

Functions

This section is empty.

Types

type Cursor

type Cursor struct {
	Limit int64
	Page  int64
}

Cursor holds operator cursor entity which is used to create listed page.

type Operator

type Operator struct {
	NodeID         storj.NodeID `json:"nodeId"`
	Email          string       `json:"email"`
	Wallet         string       `json:"wallet"`
	WalletFeatures []string     `json:"walletFeatures"`
	Undistributed  int64        `json:"undistributed"`
}

Operator contains contains SNO payouts contact details and amount of undistributed payouts.

type Page

type Page struct {
	Operators   []Operator `json:"operators"`
	Offset      int64      `json:"offset"`
	Limit       int64      `json:"limit"`
	CurrentPage int64      `json:"currentPage"`
	PageCount   int64      `json:"pageCount"`
	TotalCount  int64      `json:"totalCount"`
}

Page holds operator page entity which is used to show listed page of operators.

type Service

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

Service exposes all operators related logic.

architecture: Service

func NewService

func NewService(log *zap.Logger, dialer rpc.Dialer, nodes nodes.DB) *Service

NewService creates new instance of Service.

func (*Service) GetOperator

func (service *Service) GetOperator(ctx context.Context, node nodes.Node) (_ Operator, err error)

GetOperator retrieves operator form node via rpc.

func (*Service) ListPaginated

func (service *Service) ListPaginated(ctx context.Context, cursor Cursor) (_ Page, err error)

ListPaginated returns paginated list of operators.

Jump to

Keyboard shortcuts

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