Documentation ¶
Index ¶
- func GetValidatorPartAndStake(validator models.Validator, totalStake string, validators []uint64) (*string, *string)
- type Params
- type Repository
- func (repository Repository) GetActiveCandidatesCount() int
- func (repository Repository) GetActiveValidatorIds() []uint64
- func (repository Repository) GetByPublicKey(publicKey string) *models.Validator
- func (repository Repository) GetTotalStakeByActiveValidators(ids []uint64) string
- func (repository Repository) GetValidators() []models.Validator
- func (repository Repository) GetValidatorsBySymbol(coinSymbol string, pagination *tools.Pagination) []models.Validator
- func (repository Repository) GetValidatorsWithPagination(pagination *tools.Pagination, field *string, orderBy *string) []models.Validator
- type Resource
- type ResourceAggregator
- type ResourceWithValidators
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *pg.DB) *Repository
func (Repository) GetActiveCandidatesCount ¶
func (repository Repository) GetActiveCandidatesCount() int
Get active candidates count
func (Repository) GetActiveValidatorIds ¶
func (repository Repository) GetActiveValidatorIds() []uint64
func (Repository) GetByPublicKey ¶
func (repository Repository) GetByPublicKey(publicKey string) *models.Validator
func (Repository) GetTotalStakeByActiveValidators ¶
func (repository Repository) GetTotalStakeByActiveValidators(ids []uint64) string
func (Repository) GetValidators ¶
func (repository Repository) GetValidators() []models.Validator
Get validators
func (Repository) GetValidatorsBySymbol ¶
func (repository Repository) GetValidatorsBySymbol(coinSymbol string, pagination *tools.Pagination) []models.Validator
func (Repository) GetValidatorsWithPagination ¶
func (repository Repository) GetValidatorsWithPagination(pagination *tools.Pagination, field *string, orderBy *string) []models.Validator
type Resource ¶
type Resource struct { PublicKey string `json:"public_key"` Status *uint8 `json:"status"` Meta resource.Interface `json:"meta"` Stake *string `json:"stake"` Commission uint64 `json:"commission"` Part *string `json:"part"` Uptime *float64 `json:"uptime"` CountDelegators *uint64 `json:"count_delegators"` DelegatorCount *int `json:"delegator_count,omitempty"` DelegatorList *[]resource.Interface `json:"delegator_list,omitempty"` CreatedAt string `json:"created_at"` }
func (Resource) Transform ¶
func (r Resource) Transform(model resource.ItemInterface, values ...resource.ParamInterface) resource.Interface
Required extra params: object type of Params.
type ResourceAggregator ¶
type ResourceAggregator struct { PublicKey string `json:"public_key"` Stake *string `json:"stake"` Part *string `json:"part"` Uptime *float64 `json:"uptime"` Commission uint64 `json:"commission"` Status *uint8 `json:"status"` CreatedAt string `json:"created_at"` CountDelegators *uint64 `json:"count_delegators"` Meta resource.Interface `json:"meta"` }
func (ResourceAggregator) Transform ¶
func (ResourceAggregator) Transform(model resource.ItemInterface, params ...resource.ParamInterface) resource.Interface
type ResourceWithValidators ¶
type ResourceWithValidators struct { PublicKey string `json:"public_key"` Name string `json:"name"` SiteUrl string `json:"site_url"` IconUrl string `json:"icon_url"` Description string `json:"description"` }
func (ResourceWithValidators) Transform ¶
func (ResourceWithValidators) Transform(model resource.ItemInterface, params ...resource.ParamInterface) resource.Interface
Click to show internal directories.
Click to hide internal directories.