Documentation
¶
Index ¶
- func ClientList(clientName string, client string, notary []string, ...) (*types.CommonList, error)
- func CloseDB()
- func DeleteNotaryById(id uint) error
- func GetLastBlockTimeFromNotaryAllowance() (blockTime int64, err error)
- func GetLastEpochFromNotaryAllowance() (epoch uint64, err error)
- func GetProportionOfAllowance() ([]*types.ProportionOfSomething, error)
- func GetProportionOfAllowanceByLocation() ([]*types.ProportionOfSomething, error)
- func InitClientList() error
- func InitNotaryList() error
- func InsertClient(c *Client) error
- func InsertNotary(n *Notary) error
- func NotaryList(params *types.PaginationParams) (*types.CommonList, error)
- func Setup(conf *settingtypes.AppConfig)
- func TruncateClient() error
- func TruncateNotary() error
- func UpsertClient(c *Client) error
- func UpsertClientAllowance(c *ClientAllowance) error
- func UpsertNotaryAllowance(n *NotaryAllowance) error
- type Client
- type ClientAllowance
- type ClientAllowanceGranted
- type Model
- type Notary
- type NotaryAllowance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientList ¶
func ClientList(clientName string, client string, notary []string, params *types.PaginationParams) (*types.CommonList, error)
func DeleteNotaryById ¶
func GetProportionOfAllowance ¶
func GetProportionOfAllowance() ([]*types.ProportionOfSomething, error)
Calculate the proportion based on whether it is allocated or not
func GetProportionOfAllowanceByLocation ¶
func GetProportionOfAllowanceByLocation() ([]*types.ProportionOfSomething, error)
Calculate the proportion of notary public quota based on region
func InitClientList ¶
func InitClientList() error
func InitNotaryList ¶
func InitNotaryList() error
func InsertClient ¶
func InsertNotary ¶
func NotaryList ¶
func NotaryList(params *types.PaginationParams) (*types.CommonList, error)
func TruncateClient ¶
func TruncateClient() error
func TruncateNotary ¶
func TruncateNotary() error
func UpsertClient ¶
func UpsertClientAllowance ¶
func UpsertClientAllowance(c *ClientAllowance) error
func UpsertNotaryAllowance ¶
func UpsertNotaryAllowance(n *NotaryAllowance) error
Types ¶
type Client ¶
type Client struct { Model Name string `json:"name" gorm:"size:64;uniqueIndex:uix_client_name_addr"` //client name Website string `json:"website" gorm:"size:255"` //website、social media Region string `json:"region" gorm:"size:64"` //region Address string `json:"address" gorm:"size:255;uniqueIndex:uix_client_name_addr"` //client address }
func GetClientList ¶
type ClientAllowance ¶
type ClientAllowance struct { Model Notary string `json:"notary" gorm:"size:255;index"` // notary address Client string `json:"client" gorm:"size:255;index"` // client address Allowance decimal.Decimal `json:"allowance" gorm:"type:decimal(30,0)"` // quota BlockTime int64 `json:"block_time" gorm:"index"` // time Epoch uint64 `json:"epoch"` // height SignedCid string `json:"signed_cid" gorm:"size:255;uniqueIndex"` // info signature cid }
func (ClientAllowance) TableName ¶
func (ClientAllowance) TableName() string
type ClientAllowanceGranted ¶
type ClientAllowanceGranted struct { Date int64 `json:"date"` Granted decimal.Decimal `json:"granted"` }
func GetClientAllowanceGrantedDaily ¶
func GetClientAllowanceGrantedDaily(limit int64) ([]*ClientAllowanceGranted, error)
type Notary ¶
type Notary struct { Model NotaryName string `json:"notary_name" gorm:"size:64"` //notary name Organization string `json:"organization" gorm:"size:128"` //organization Address string `json:"address" gorm:"size:255;unique_index"` //notary address Location string `json:"location" gorm:"size:64"` //region Website string `json:"website" gorm:"size:255"` //website、social media Remark string `json:"remark" gorm:"size:255"` //remark GithubUser string `json:"github_user" gorm:"size:128"` //github account LastLoginTime *types.UnixTime `json:"last_login_time,omitempty"` //the latest login time }
type NotaryAllowance ¶
type NotaryAllowance struct { Model TxnId int64 `json:"txn_id"` Address string `json:"address" gorm:"size:255;index"` // notary address Allowance decimal.Decimal `json:"allowance" gorm:"type:decimal(30,0)"` // quota BlockTime int64 `json:"block_time"` // time Epoch uint64 `json:"epoch" gorm:"index"` // height SignedCid string `json:"signed_cid" gorm:"size:255;uniqueIndex"` // info signature cid }
func (NotaryAllowance) TableName ¶
func (NotaryAllowance) TableName() string
Click to show internal directories.
Click to hide internal directories.