server

package
Version: v0.0.0-...-af91b5d Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: MIT Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EC_NO_ROUTE = 1000 + iota
	EC_CONTENTTYPE_UNSUPPORTED
	EC_CONTENTTYPE_UNEXPECTED
	EC_MARSHAL_FAILED
	EC_DEMARSHAL_FAILED
	EC_BAD_URL_QUERY
	EC_PARAM_REQUIRED
	EC_PARAM_INVALID
	EC_PARAM_NOISOLANG
	EC_PARAM_NOISOCOUNTRY
	EC_PARAM_NOTEXPECTED
)

10xx - HTTP errors

View Source
const (
	EC_DATABASE = 1100 + iota
	EC_SERVER
	EC_RPC
	EC_NETWORK
)

11xx - internal server error codes

View Source
const (
	EC_ACCESS_HEADER_MISSING = 1200 + iota
	EC_ACCESS_APIKEY_MISSING
	EC_ACCESS_APIKEY_INVALID
	EC_ACCESS_APIKEY_INACTIVE
	EC_ACCESS_APIVERSION_INVALID
	EC_ACCESS_METHOD_UNSUPPORTED
	EC_ACCESS_ORIGIN_DENIED
	EC_ACCESS_TOKEN_MISSING
	EC_ACCESS_TOKEN_MALFORMED
	EC_ACCESS_TOKEN_INVALID
	EC_ACCESS_TOKEN_REVOKED
	EC_ACCESS_TOKEN_EXPIRED
	EC_ACCESS_SCOPES_INSUFFICIENT
	EC_ACCESS_RATE_LIMITED
	EC_ACCESS_READONLY
	EC_ACCESS_DENIED
)

12xx - Access errors

View Source
const (
	EC_RESOURCE_ID_MISSING = 1300 + iota
	EC_RESOURCE_ID_MALFORMED
	EC_RESOURCE_VERSION_MISMATCH
	EC_RESOURCE_TYPE_MISMATCH
	EC_RESOURCE_CONFLICT
	EC_RESOURCE_NOTFOUND
	EC_RESOURCE_EXISTS
	EC_RESOURCE_CREATE_FAILED
	EC_RESOURCE_UPDATE_FAILED
	EC_RESOURCE_DELETE_FAILED
	EC_RESOURCE_STATE_UNEXPECTED
)

13xx - Resource errors

Variables

View Source
var (
	EBadRequest         = NewWrappedError(http.StatusBadRequest, "incorrect request syntax")
	EUnauthorized       = NewWrappedError(http.StatusUnauthorized, "authentication required")
	EForbidden          = NewWrappedError(http.StatusForbidden, "access forbidden")
	ENotFound           = NewWrappedError(http.StatusNotFound, "resource not found")
	ENotAllowed         = NewWrappedError(http.StatusMethodNotAllowed, "method not allowed")
	ENotAcceptable      = NewWrappedError(http.StatusNotAcceptable, "unsupported response type")
	EBadMimetype        = NewWrappedError(http.StatusUnsupportedMediaType, "unsupported media type")
	EConflict           = NewWrappedError(http.StatusConflict, "resource state conflict")
	EInternal           = NewWrappedError(http.StatusInternalServerError, "internal server error")
	ERequestTooLarge    = NewWrappedError(http.StatusRequestEntityTooLarge, "request size exceeds our limits")
	ETooManyRequests    = NewWrappedError(http.StatusTooManyRequests, "request limit exceeded")
	EServiceUnavailable = NewWrappedError(http.StatusServiceUnavailable, "service temporarily unavailable")
	ENotImplemented     = NewWrappedError(http.StatusNotImplemented, "not implemented")
	EConnectionClosed   = NewWrappedError(499, "connection closed")
)

Server Error Reasons

View Source
var (
	UserAgent  = "Blockwatch-TzIndex/1.0"
	ApiVersion string
)
View Source
var LoggerMap map[string]logpkg.Logger

Functions

func BoolPtr

func BoolPtr(b bool) *bool

func C

func C(f ApiCall) func(http.ResponseWriter, *http.Request)

func CreateMetadata

func CreateMetadata(ctx *ApiContext) (interface{}, int)

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.

func DumpTable

func DumpTable(ctx *ApiContext) (interface{}, int)

func Float64Ptr

func Float64Ptr(f float64) *float64

func FlushDatabases

func FlushDatabases(ctx *ApiContext) (interface{}, int)

func FlushJournals

func FlushJournals(ctx *ApiContext) (interface{}, int)

func GcDatabases

func GcDatabases(ctx *ApiContext) (interface{}, int)

func GetBlockchainConfig

func GetBlockchainConfig(ctx *ApiContext) (interface{}, int)

func GetBlockchainProtocols

func GetBlockchainProtocols(ctx *ApiContext) (interface{}, int)

func GetBlockchainTip

func GetBlockchainTip(ctx *ApiContext) (interface{}, int)

func GetCacheStats

func GetCacheStats(ctx *ApiContext) (interface{}, int)

func GetConfig

func GetConfig(ctx *ApiContext) (interface{}, int)

func GetMemStats

func GetMemStats(ctx *ApiContext) (interface{}, int)

func GetRichList

func GetRichList(ctx *ApiContext) (interface{}, int)

func GetStatus

func GetStatus(ctx *ApiContext) (interface{}, int)

func GetTableStats

func GetTableStats(ctx *ApiContext) (interface{}, int)

func GetTrafficList

func GetTrafficList(ctx *ApiContext) (interface{}, int)

func GetVolumeList

func GetVolumeList(ctx *ApiContext) (interface{}, int)

func IntPtr

func IntPtr(i int) *int

func ListAccountBallots

func ListAccountBallots(ctx *ApiContext) (interface{}, int)

func ListAccountOperations

func ListAccountOperations(ctx *ApiContext) (interface{}, int)

func ListBakers

func ListBakers(ctx *ApiContext) (interface{}, int)

func ListBallots

func ListBallots(ctx *ApiContext) (interface{}, int)

func ListBigmapKeyUpdates

func ListBigmapKeyUpdates(ctx *ApiContext) (interface{}, int)

func ListBigmapKeys

func ListBigmapKeys(ctx *ApiContext) (interface{}, int)

func ListBigmapUpdates

func ListBigmapUpdates(ctx *ApiContext) (interface{}, int)

func ListBigmapValues

func ListBigmapValues(ctx *ApiContext) (interface{}, int)

func ListBlockOps

func ListBlockOps(ctx *ApiContext) (interface{}, int)

func ListMetadata

func ListMetadata(ctx *ApiContext) (interface{}, int)

func ListMetadataSchemas

func ListMetadataSchemas(ctx *ApiContext) (interface{}, int)

func ListVoters

func ListVoters(ctx *ApiContext) (interface{}, int)

func MapError

func MapError(scope, msg string, err error) error

func NewRouter

func NewRouter() *mux.Router

Generate a new API router with support for HTTP OPTIONS

func NotFound

func NotFound(ctx *ApiContext) (interface{}, int)

func ParseErrorFromByte

func ParseErrorFromByte(b []byte, status int) error

func ParseErrorFromStream

func ParseErrorFromStream(i io.Reader, status int) error

func Ping

func Ping(ctx *ApiContext) (interface{}, int)

func PurgeCaches

func PurgeCaches(ctx *ApiContext) (interface{}, int)

func PurgeMetadata

func PurgeMetadata(ctx *ApiContext) (interface{}, int)

func ReadAccount

func ReadAccount(ctx *ApiContext) (interface{}, int)

func ReadAccountOps

func ReadAccountOps(ctx *ApiContext) (interface{}, int)

LEGACY

func ReadBigmap

func ReadBigmap(ctx *ApiContext) (interface{}, int)

func ReadBigmapValue

func ReadBigmapValue(ctx *ApiContext) (interface{}, int)

func ReadBlock

func ReadBlock(ctx *ApiContext) (interface{}, int)

func ReadBlockOps

func ReadBlockOps(ctx *ApiContext) (interface{}, int)

LEGACY

func ReadContract

func ReadContract(ctx *ApiContext) (interface{}, int)

func ReadContractCalls

func ReadContractCalls(ctx *ApiContext) (interface{}, int)

list incoming transaction with data

func ReadContractCreator

func ReadContractCreator(ctx *ApiContext) (interface{}, int)

func ReadContractScript

func ReadContractScript(ctx *ApiContext) (interface{}, int)

func ReadContractStorage

func ReadContractStorage(ctx *ApiContext) (interface{}, int)

func ReadCycle

func ReadCycle(ctx *ApiContext) (interface{}, int)

func ReadElection

func ReadElection(ctx *ApiContext) (interface{}, int)

func ReadManagedAccounts

func ReadManagedAccounts(ctx *ApiContext) (interface{}, int)

func ReadMetadata

func ReadMetadata(ctx *ApiContext) (interface{}, int)

func ReadMetadataSchema

func ReadMetadataSchema(ctx *ApiContext) (interface{}, int)

func ReadOp

func ReadOp(ctx *ApiContext) (interface{}, int)

func RemoveMetadata

func RemoveMetadata(ctx *ApiContext) (interface{}, int)

func RollbackDatabases

func RollbackDatabases(ctx *ApiContext) (interface{}, int)

func SnapshotDatabases

func SnapshotDatabases(ctx *ApiContext) (interface{}, int)

func StateOptions

func StateOptions(ctx *ApiContext) (interface{}, int)

Respond to requests with the OPTIONS Method.

func StreamAccountTable

func StreamAccountTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func StreamBallotTable

func StreamBallotTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func StreamBigmapAllocTable

func StreamBigmapAllocTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func StreamBigmapUpdateTable

func StreamBigmapUpdateTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func StreamBigmapValueTable

func StreamBigmapValueTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func StreamBlockTable

func StreamBlockTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func StreamChainTable

func StreamChainTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func StreamContractTable

func StreamContractTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func StreamElectionTable

func StreamElectionTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func StreamFlowTable

func StreamFlowTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func StreamIncomeTable

func StreamIncomeTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func StreamOpTable

func StreamOpTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func StreamProposalTable

func StreamProposalTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func StreamRightsTable

func StreamRightsTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func StreamSeries

func StreamSeries(ctx *ApiContext) (interface{}, int)

func StreamSnapshotTable

func StreamSnapshotTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func StreamSupplyTable

func StreamSupplyTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func StreamTable

func StreamTable(ctx *ApiContext) (interface{}, int)

func StreamVoteTable

func StreamVoteTable(ctx *ApiContext, args *TableRequest) (interface{}, int)

func UpdateLog

func UpdateLog(ctx *ApiContext) (interface{}, int)

func UpdateMetadata

func UpdateMetadata(ctx *ApiContext) (interface{}, int)

func UseLogger

func UseLogger(logger logpkg.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type Account

type Account struct {
	model.Account
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*Account) MarshalCSV

func (a *Account) MarshalCSV() ([]string, error)

func (*Account) MarshalJSON

func (a *Account) MarshalJSON() ([]byte, error)

func (*Account) MarshalJSONBrief

func (a *Account) MarshalJSONBrief() ([]byte, error)

func (*Account) MarshalJSONVerbose

func (a *Account) MarshalJSONVerbose() ([]byte, error)

type AccountRequest

type AccountRequest struct {
	ListRequest      // offset, limit, cursor, order
	Meta        bool `schema:"meta"` // include account metadata
}

func (*AccountRequest) WithCollapse

func (r *AccountRequest) WithCollapse() bool

func (*AccountRequest) WithHeight

func (r *AccountRequest) WithHeight() int64

func (*AccountRequest) WithMeta

func (r *AccountRequest) WithMeta() bool

func (*AccountRequest) WithPrim

func (r *AccountRequest) WithPrim() bool

func (*AccountRequest) WithRights

func (r *AccountRequest) WithRights() bool

func (*AccountRequest) WithUnpack

func (r *AccountRequest) WithUnpack() bool

type ApiCall

type ApiCall func(*ApiContext) (interface{}, int)

type ApiContext

type ApiContext struct {
	context.Context
	// request data
	Request        *http.Request
	ResponseWriter http.ResponseWriter
	RemoteIP       net.IP
	Cfg            *Config
	Server         *RestServer
	Crawler        *etl.Crawler
	Indexer        *etl.Indexer
	Client         *rpc.Client
	Tip            *model.ChainTip
	Params         *tezos.Params

	// QoS and Debugging
	RequestID string
	Log       logpkg.Logger

	// Statistics
	Now         time.Time
	Performance *PerformanceCounter
	// contains filtered or unexported fields
}

func NewContext

func NewContext(ctx context.Context, r *http.Request, w http.ResponseWriter, f ApiCall, srv *RestServer) *ApiContext

func (*ApiContext) ParseRequestArgs

func (api *ApiContext) ParseRequestArgs(args interface{})

GET/POST/PATCH/PATCH load data or fail

func (*ApiContext) RequestString

func (api *ApiContext) RequestString() string

func (*ApiContext) StreamResponseHeaders

func (api *ApiContext) StreamResponseHeaders(status int, contentType string)

func (*ApiContext) StreamTrailer

func (api *ApiContext) StreamTrailer(cursor string, count int, err error)

type ApiErrorWrapper

type ApiErrorWrapper func(code int, detail string, err error) *Error

func NewWrappedApiError

func NewWrappedApiError(status int, msg string) ApiErrorWrapper

type BakerList

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

func (BakerList) Expires

func (l BakerList) Expires() time.Time

func (BakerList) LastModified

func (l BakerList) LastModified() time.Time

func (BakerList) MarshalJSON

func (l BakerList) MarshalJSON() ([]byte, error)

func (BakerList) RESTPath

func (l BakerList) RESTPath(r *mux.Router) string

func (BakerList) RESTPrefix

func (_ BakerList) RESTPrefix() string

func (BakerList) RegisterDirectRoutes

func (a BakerList) RegisterDirectRoutes(r *mux.Router) error

func (BakerList) RegisterRoutes

func (b BakerList) RegisterRoutes(r *mux.Router) error

type BakerListRequest

type BakerListRequest struct {
	ListRequest
	Status  *string        `schema:"status"`
	Country *iso.Country   `schema:"country"`
	Suggest *tezos.Address `schema:"suggest"`
}

type Ballot

type Ballot struct {
	model.Ballot
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*Ballot) MarshalCSV

func (b *Ballot) MarshalCSV() ([]string, error)

func (*Ballot) MarshalJSON

func (b *Ballot) MarshalJSON() ([]byte, error)

func (*Ballot) MarshalJSONBrief

func (b *Ballot) MarshalJSONBrief() ([]byte, error)

func (*Ballot) MarshalJSONVerbose

func (b *Ballot) MarshalJSONVerbose() ([]byte, error)

type BigmapAllocItem

type BigmapAllocItem struct {
	model.BigmapAlloc
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*BigmapAllocItem) MarshalCSV

func (b *BigmapAllocItem) MarshalCSV() ([]string, error)

func (*BigmapAllocItem) MarshalJSON

func (b *BigmapAllocItem) MarshalJSON() ([]byte, error)

func (*BigmapAllocItem) MarshalJSONBrief

func (b *BigmapAllocItem) MarshalJSONBrief() ([]byte, error)

func (*BigmapAllocItem) MarshalJSONVerbose

func (b *BigmapAllocItem) MarshalJSONVerbose() ([]byte, error)

type BigmapUpdateItem

type BigmapUpdateItem struct {
	model.BigmapUpdate
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*BigmapUpdateItem) MarshalCSV

func (b *BigmapUpdateItem) MarshalCSV() ([]string, error)

func (*BigmapUpdateItem) MarshalJSON

func (b *BigmapUpdateItem) MarshalJSON() ([]byte, error)

func (*BigmapUpdateItem) MarshalJSONBrief

func (b *BigmapUpdateItem) MarshalJSONBrief() ([]byte, error)

func (*BigmapUpdateItem) MarshalJSONVerbose

func (b *BigmapUpdateItem) MarshalJSONVerbose() ([]byte, error)

type BigmapValueItem

type BigmapValueItem struct {
	model.BigmapKV
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*BigmapValueItem) MarshalCSV

func (b *BigmapValueItem) MarshalCSV() ([]string, error)

func (*BigmapValueItem) MarshalJSON

func (b *BigmapValueItem) MarshalJSON() ([]byte, error)

func (*BigmapValueItem) MarshalJSONBrief

func (b *BigmapValueItem) MarshalJSONBrief() ([]byte, error)

func (*BigmapValueItem) MarshalJSONVerbose

func (b *BigmapValueItem) MarshalJSONVerbose() ([]byte, error)

type Block

type Block struct {
	model.Block
	Predecessor tezos.BlockHash `pack:"predecessor" json:"predecessor"`
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*Block) MarshalCSV

func (b *Block) MarshalCSV() ([]string, error)

func (*Block) MarshalJSON

func (b *Block) MarshalJSON() ([]byte, error)

func (*Block) MarshalJSONBrief

func (b *Block) MarshalJSONBrief() ([]byte, error)

func (*Block) MarshalJSONVerbose

func (b *Block) MarshalJSONVerbose() ([]byte, error)

type BlockRequest

type BlockRequest struct {
	Meta   bool `schema:"meta"`   // include account metadata
	Rights bool `schema:"rights"` // include rights
}

func (*BlockRequest) WithCollapse

func (r *BlockRequest) WithCollapse() bool

func (*BlockRequest) WithHeight

func (r *BlockRequest) WithHeight() int64

func (*BlockRequest) WithMeta

func (r *BlockRequest) WithMeta() bool

func (*BlockRequest) WithPrim

func (r *BlockRequest) WithPrim() bool

func (*BlockRequest) WithRights

func (r *BlockRequest) WithRights() bool

func (*BlockRequest) WithUnpack

func (r *BlockRequest) WithUnpack() bool

type BlockSeries

type BlockSeries struct {
	Timestamp           time.Time `json:"time"`
	Count               int       `json:"count"`
	NSlotsEndorsed      int64     `json:"n_endorsed_slots"`
	NOps                int64     `json:"n_ops"`
	NOpsFailed          int64     `json:"n_ops_failed"`
	NOpsContract        int64     `json:"n_ops_contract"`
	NTx                 int64     `json:"n_tx"`
	NActivation         int64     `json:"n_activation"`
	NSeedNonce          int64     `json:"n_seed_nonce_revelation"`
	N2Baking            int64     `json:"n_double_baking_evidence"`
	N2Endorsement       int64     `json:"n_double_endorsement_evidence"`
	NEndorsement        int64     `json:"n_endorsement"`
	NDelegation         int64     `json:"n_delegation"`
	NReveal             int64     `json:"n_reveal"`
	NOrigination        int64     `json:"n_origination"`
	NProposal           int64     `json:"n_proposal"`
	NBallot             int64     `json:"n_ballot"`
	Volume              int64     `json:"volume"`
	Fee                 int64     `json:"fee"`
	Reward              int64     `json:"reward"`
	Deposit             int64     `json:"deposit"`
	UnfrozenFees        int64     `json:"unfrozen_fees"`
	UnfrozenRewards     int64     `json:"unfrozen_rewards"`
	UnfrozenDeposits    int64     `json:"unfrozen_deposits"`
	ActivatedSupply     int64     `json:"activated_supply"`
	BurnedSupply        int64     `json:"burned_supply"`
	NewAccounts         int64     `json:"n_new_accounts"`
	NewImplicitAccounts int64     `json:"n_new_implicit"`
	NewManagedAccounts  int64     `json:"n_new_managed"`
	NewContracts        int64     `json:"n_new_contracts"`
	ClearedAccounts     int64     `json:"n_cleared_accounts"`
	FundedAccounts      int64     `json:"n_funded_accounts"`
	GasUsed             int64     `json:"gas_used"`
	StorageSize         int64     `json:"storage_size"`
	TDD                 float64   `json:"days_destroyed"`
	NOpsImplicit        int64     `json:"n_ops_implicit"`
	// contains filtered or unexported fields
}

Only use fields that can be summed over time configurable marshalling helper

func (*BlockSeries) Add

func (s *BlockSeries) Add(m SeriesModel)

func (*BlockSeries) BuildQuery

func (s *BlockSeries) BuildQuery(ctx *ApiContext, args *SeriesRequest) pack.Query

func (*BlockSeries) Clone

func (s *BlockSeries) Clone() SeriesBucket

func (*BlockSeries) Init

func (s *BlockSeries) Init(params *tezos.Params, columns []string, verbose bool)

func (*BlockSeries) Interpolate

func (s *BlockSeries) Interpolate(m SeriesBucket, ts time.Time) SeriesBucket

func (*BlockSeries) IsEmpty

func (s *BlockSeries) IsEmpty() bool

func (*BlockSeries) MarshalCSV

func (b *BlockSeries) MarshalCSV() ([]string, error)

func (*BlockSeries) MarshalJSON

func (s *BlockSeries) MarshalJSON() ([]byte, error)

func (*BlockSeries) MarshalJSONBrief

func (b *BlockSeries) MarshalJSONBrief() ([]byte, error)

func (*BlockSeries) MarshalJSONVerbose

func (b *BlockSeries) MarshalJSONVerbose() ([]byte, error)

func (*BlockSeries) Null

func (s *BlockSeries) Null(ts time.Time) SeriesBucket

func (*BlockSeries) Reset

func (s *BlockSeries) Reset()

func (*BlockSeries) SetTime

func (s *BlockSeries) SetTime(ts time.Time) SeriesBucket

func (*BlockSeries) Time

func (s *BlockSeries) Time() time.Time

func (*BlockSeries) Zero

func (s *BlockSeries) Zero(ts time.Time) SeriesBucket

type BlockchainConfig

type BlockchainConfig struct {
	// chain identity
	Name        string             `json:"name"`
	Network     string             `json:"network"`
	Symbol      string             `json:"symbol"`
	ChainId     tezos.ChainIdHash  `json:"chain_id"`
	Deployment  int                `json:"deployment"`
	Version     int                `json:"version"`
	Protocol    tezos.ProtocolHash `json:"protocol"`
	StartHeight int64              `json:"start_height"`
	EndHeight   int64              `json:"end_height"`

	// fixed
	NoRewardCycles              int64 `json:"no_reward_cycles"`                // from mainnet genesis
	SecurityDepositRampUpCycles int64 `json:"security_deposit_ramp_up_cycles"` // increase 1/64th each cycle
	Decimals                    int   `json:"decimals"`
	Token                       int64 `json:"units"` // atomic units per token

	// may change with protocol updates
	BlockReward                       float64    `json:"block_reward"`
	BlockSecurityDeposit              float64    `json:"block_security_deposit"`
	BlocksPerCommitment               int64      `json:"blocks_per_commitment"`
	BlocksPerCycle                    int64      `json:"blocks_per_cycle"`
	BlocksPerRollSnapshot             int64      `json:"blocks_per_roll_snapshot"`
	BlocksPerVotingPeriod             int64      `json:"blocks_per_voting_period"`
	CostPerByte                       int64      `json:"cost_per_byte"`
	EndorsementReward                 float64    `json:"endorsement_reward"`
	EndorsementSecurityDeposit        float64    `json:"endorsement_security_deposit"`
	EndorsersPerBlock                 int        `json:"endorsers_per_block"`
	HardGasLimitPerBlock              int64      `json:"hard_gas_limit_per_block"`
	HardGasLimitPerOperation          int64      `json:"hard_gas_limit_per_operation"`
	HardStorageLimitPerOperation      int64      `json:"hard_storage_limit_per_operation"`
	MaxOperationDataLength            int        `json:"max_operation_data_length"`
	MaxProposalsPerDelegate           int        `json:"max_proposals_per_delegate"`
	MaxRevelationsPerBlock            int        `json:"max_revelations_per_block"`
	MichelsonMaximumTypeSize          int        `json:"michelson_maximum_type_size"`
	NonceLength                       int        `json:"nonce_length"`
	OriginationBurn                   float64    `json:"origination_burn"`
	OriginationSize                   int64      `json:"origination_size"`
	PreservedCycles                   int64      `json:"preserved_cycles"`
	ProofOfWorkNonceSize              int        `json:"proof_of_work_nonce_size"`
	ProofOfWorkThreshold              int64      `json:"proof_of_work_threshold"`
	SeedNonceRevelationTip            float64    `json:"seed_nonce_revelation_tip"`
	TimeBetweenBlocks                 [2]int     `json:"time_between_blocks"`
	TokensPerRoll                     float64    `json:"tokens_per_roll"`
	TestChainDuration                 int64      `json:"test_chain_duration"`
	MinProposalQuorum                 int64      `json:"min_proposal_quorum"`
	QuorumMin                         int64      `json:"quorum_min"`
	QuorumMax                         int64      `json:"quorum_max"`
	BlockRewardV6                     [2]float64 `json:"block_rewards_v6"`
	EndorsementRewardV6               [2]float64 `json:"endorsement_rewards_v6"`
	MaxAnonOpsPerBlock                int        `json:"max_anon_ops_per_block"`
	LiquidityBakingEscapeEmaThreshold int64      `json:"liquidity_baking_escape_ema_threshold"`
	LiquidityBakingSubsidy            int64      `json:"liquidity_baking_subsidy"`
	LiquidityBakingSunsetLevel        int64      `json:"liquidity_baking_sunset_level"`
	MinimalBlockDelay                 int        `json:"minimal_block_delay"`

	// extra
	NumVotingPeriods int `json:"num_voting_periods"`
	// contains filtered or unexported fields
}

func (BlockchainConfig) Expires

func (c BlockchainConfig) Expires() time.Time

func (BlockchainConfig) LastModified

func (c BlockchainConfig) LastModified() time.Time

type BlockchainTip

type BlockchainTip struct {
	Name        string            `json:"name"`
	Network     string            `json:"network"`
	Symbol      string            `json:"symbol"`
	ChainId     tezos.ChainIdHash `json:"chain_id"`
	GenesisTime time.Time         `json:"genesis_time"`
	BestHash    tezos.BlockHash   `json:"block_hash"`
	Timestamp   time.Time         `json:"timestamp"`
	Height      int64             `json:"height"`
	Cycle       int64             `json:"cycle"`

	TotalAccounts  int64 `json:"total_accounts"`
	FundedAccounts int64 `json:"funded_accounts"`
	TotalOps       int64 `json:"total_ops"`
	Delegators     int64 `json:"delegators"`
	Delegates      int64 `json:"delegates"`
	Rolls          int64 `json:"rolls"`
	RollOwners     int64 `json:"roll_owners"`

	NewAccounts30d     int64   `json:"new_accounts_30d"`
	ClearedAccounts30d int64   `json:"cleared_accounts_30d"`
	FundedAccounts30d  int64   `json:"funded_accounts_30d"`
	Inflation1Y        float64 `json:"inflation_1y"`
	InflationRate1Y    float64 `json:"inflation_rate_1y"`

	Health int `json:"health"`

	Deployments []model.Deployment `json:"deployments"`
	Supply      *Supply            `json:"supply"`
	Status      etl.CrawlerStatus  `json:"status"`
	// contains filtered or unexported fields
}

func (BlockchainTip) Expires

func (t BlockchainTip) Expires() time.Time

func (BlockchainTip) LastModified

func (t BlockchainTip) LastModified() time.Time

type Chain

type Chain struct {
	model.Chain
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*Chain) MarshalCSV

func (c *Chain) MarshalCSV() ([]string, error)

func (*Chain) MarshalJSON

func (c *Chain) MarshalJSON() ([]byte, error)

func (*Chain) MarshalJSONBrief

func (c *Chain) MarshalJSONBrief() ([]byte, error)

func (*Chain) MarshalJSONVerbose

func (c *Chain) MarshalJSONVerbose() ([]byte, error)

type ChainSeries

type ChainSeries struct {
	model.Chain
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*ChainSeries) Add

func (s *ChainSeries) Add(m SeriesModel)

func (*ChainSeries) BuildQuery

func (s *ChainSeries) BuildQuery(ctx *ApiContext, args *SeriesRequest) pack.Query

func (*ChainSeries) Clone

func (s *ChainSeries) Clone() SeriesBucket

func (*ChainSeries) Init

func (s *ChainSeries) Init(params *tezos.Params, columns []string, verbose bool)

func (*ChainSeries) Interpolate

func (s *ChainSeries) Interpolate(m SeriesBucket, ts time.Time) SeriesBucket

func (*ChainSeries) IsEmpty

func (s *ChainSeries) IsEmpty() bool

func (*ChainSeries) MarshalCSV

func (c *ChainSeries) MarshalCSV() ([]string, error)

func (*ChainSeries) MarshalJSON

func (c *ChainSeries) MarshalJSON() ([]byte, error)

func (*ChainSeries) MarshalJSONBrief

func (c *ChainSeries) MarshalJSONBrief() ([]byte, error)

func (*ChainSeries) MarshalJSONVerbose

func (c *ChainSeries) MarshalJSONVerbose() ([]byte, error)

func (*ChainSeries) Null

func (c *ChainSeries) Null(ts time.Time) SeriesBucket

func (*ChainSeries) Reset

func (c *ChainSeries) Reset()

func (*ChainSeries) SetTime

func (s *ChainSeries) SetTime(ts time.Time) SeriesBucket

func (*ChainSeries) Time

func (s *ChainSeries) Time() time.Time

func (*ChainSeries) Zero

func (s *ChainSeries) Zero(ts time.Time) SeriesBucket

type Config

type Config struct {
	Crawler *etl.Crawler
	Indexer *etl.Indexer
	Client  *rpc.Client
	Http    HttpConfig
}

func (Config) ClampExplore

func (c Config) ClampExplore(count uint) uint

func (Config) ClampExplore64

func (c Config) ClampExplore64(count int64) int64

func (Config) ClampList

func (c Config) ClampList(count uint) uint

func (Config) ClampList64

func (c Config) ClampList64(count int64) int64

type Contract

type Contract struct {
	model.Contract
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*Contract) MarshalCSV

func (c *Contract) MarshalCSV() ([]string, error)

func (*Contract) MarshalJSON

func (c *Contract) MarshalJSON() ([]byte, error)

func (*Contract) MarshalJSONBrief

func (c *Contract) MarshalJSONBrief() ([]byte, error)

func (*Contract) MarshalJSONVerbose

func (c *Contract) MarshalJSONVerbose() ([]byte, error)

type ContractRequest

type ContractRequest struct {
	ListRequest // offset, limit, cursor, order

	Block    string        `schema:"block"`    // height or hash for time-lock
	Since    string        `schema:"since"`    // block hash or height for updates
	Unpack   bool          `schema:"unpack"`   // unpack packed key/values
	Prim     bool          `schema:"prim"`     // for prim/value rendering
	Meta     bool          `schema:"meta"`     // include account metadata
	Collapse bool          `schema:"collapse"` // collapse internal calls
	Sender   tezos.Address `schema:"sender"`   // sender address

	// decoded entrypoint condition (list of name, num or branch)
	EntrypointMode pack.FilterMode `schema:"-"`
	EntrypointCond string          `schema:"-"`

	// decoded values
	BlockHeight int64           `schema:"-"`
	BlockHash   tezos.BlockHash `schema:"-"`
	SinceHeight int64           `schema:"-"`
	SinceHash   tezos.BlockHash `schema:"-"`
}

func (*ContractRequest) Parse

func (r *ContractRequest) Parse(ctx *ApiContext)

func (*ContractRequest) WithCollapse

func (r *ContractRequest) WithCollapse() bool

func (*ContractRequest) WithHeight

func (r *ContractRequest) WithHeight() int64

func (*ContractRequest) WithMeta

func (r *ContractRequest) WithMeta() bool

func (*ContractRequest) WithPrim

func (r *ContractRequest) WithPrim() bool

func (*ContractRequest) WithRights

func (r *ContractRequest) WithRights() bool

func (*ContractRequest) WithUnpack

func (r *ContractRequest) WithUnpack() bool

type Dispatcher

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

func NewDispatcher

func NewDispatcher(maxWorkers int, maxQueue int) *Dispatcher

func (*Dispatcher) Run

func (d *Dispatcher) Run()

type Election

type Election struct {
	model.Election
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*Election) MarshalCSV

func (e *Election) MarshalCSV() ([]string, error)

func (*Election) MarshalJSON

func (e *Election) MarshalJSON() ([]byte, error)

func (*Election) MarshalJSONBrief

func (e *Election) MarshalJSONBrief() ([]byte, error)

func (*Election) MarshalJSONVerbose

func (e *Election) MarshalJSONVerbose() ([]byte, error)

type Error

type Error struct {
	Code      int    `json:"code"`
	Status    int    `json:"status"`
	Message   string `json:"message"`
	Scope     string `json:"scope"`
	Detail    string `json:"detail"`
	RequestId string `json:"request_id,omitempty"`
	Cause     error  `json:"-"`
	Reason    string `json:"reason,omitempty"`
}

func (*Error) Complete

func (e *Error) Complete(code int, detail string, err error) error

func (*Error) CompleteApiError

func (e *Error) CompleteApiError(code int, detail string, err error) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Marshal

func (e *Error) Marshal() []byte

func (*Error) MarshalIndent

func (e *Error) MarshalIndent() []byte

func (*Error) SetScope

func (e *Error) SetScope(s string) *Error

func (*Error) String

func (e *Error) String() string

type ErrorList

type ErrorList []*Error

type ErrorResponse

type ErrorResponse struct {
	Errors ErrorList `json:"errors"`
}

type ErrorWrapper

type ErrorWrapper func(code int, detail string, err error) error

func NewWrappedError

func NewWrappedError(status int, msg string) ErrorWrapper

type Explorer

type Explorer struct{}

func (Explorer) Expires

func (e Explorer) Expires() time.Time

func (Explorer) LastModified

func (e Explorer) LastModified() time.Time

func (Explorer) RESTPath

func (e Explorer) RESTPath(r *mux.Router) string

func (Explorer) RESTPrefix

func (e Explorer) RESTPrefix() string

func (Explorer) RegisterDirectRoutes

func (e Explorer) RegisterDirectRoutes(r *mux.Router) error

func (Explorer) RegisterRoutes

func (b Explorer) RegisterRoutes(r *mux.Router) error

type ExplorerAccount

type ExplorerAccount struct {
	Address            string                       `json:"address"`
	Type               string                       `json:"address_type"`
	Delegate           string                       `json:"delegate,omitempty"`
	Creator            string                       `json:"creator,omitempty"`
	Pubkey             tezos.Key                    `json:"pubkey,omitempty"`
	FirstIn            int64                        `json:"first_in"`
	FirstOut           int64                        `json:"first_out"`
	LastIn             int64                        `json:"last_in"`
	LastOut            int64                        `json:"last_out"`
	FirstSeen          int64                        `json:"first_seen"`
	LastSeen           int64                        `json:"last_seen"`
	DelegatedSince     int64                        `json:"delegated_since,omitempty"`
	DelegateSince      int64                        `json:"delegate_since,omitempty"`
	DelegateUntil      int64                        `json:"delegate_until,omitempty"`
	FirstInTime        *time.Time                   `json:"first_in_time,omitempty"`
	FirstOutTime       *time.Time                   `json:"first_out_time,omitempty"`
	LastInTime         *time.Time                   `json:"last_in_time,omitempty"`
	LastOutTime        *time.Time                   `json:"last_out_time,omitempty"`
	FirstSeenTime      time.Time                    `json:"first_seen_time,omitempty"`
	LastSeenTime       time.Time                    `json:"last_seen_time,omitempty"`
	DelegatedSinceTime *time.Time                   `json:"delegated_since_time,omitempty"`
	DelegateSinceTime  *time.Time                   `json:"delegate_since_time,omitempty"`
	DelegateUntilTime  *time.Time                   `json:"delegate_until_time,omitempty"`
	TotalReceived      float64                      `json:"total_received"`
	TotalSent          float64                      `json:"total_sent"`
	TotalBurned        float64                      `json:"total_burned"`
	TotalFeesPaid      float64                      `json:"total_fees_paid"`
	TotalRewardsEarned *float64                     `json:"total_rewards_earned,omitempty"`
	TotalFeesEarned    *float64                     `json:"total_fees_earned,omitempty"`
	TotalLost          *float64                     `json:"total_lost,omitempty"`
	FrozenDeposits     *float64                     `json:"frozen_deposits,omitempty"`
	FrozenRewards      *float64                     `json:"frozen_rewards,omitempty"`
	FrozenFees         *float64                     `json:"frozen_fees,omitempty"`
	UnclaimedBalance   float64                      `json:"unclaimed_balance,omitempty"`
	SpendableBalance   float64                      `json:"spendable_balance"`
	TotalBalance       float64                      `json:"total_balance"`
	DelegatedBalance   *float64                     `json:"delegated_balance,omitempty"`
	TotalDelegations   *int64                       `json:"total_delegations,omitempty"`
	ActiveDelegations  *int64                       `json:"active_delegations,omitempty"`
	IsFunded           bool                         `json:"is_funded"`
	IsActivated        bool                         `json:"is_activated"`
	IsDelegated        bool                         `json:"is_delegated"`
	IsRevealed         bool                         `json:"is_revealed"`
	IsDelegate         bool                         `json:"is_delegate"`
	IsActiveDelegate   bool                         `json:"is_active_delegate"`
	IsContract         bool                         `json:"is_contract"`
	BlocksBaked        *int                         `json:"blocks_baked,omitempty"`
	BlocksMissed       *int                         `json:"blocks_missed,omitempty"`
	BlocksStolen       *int                         `json:"blocks_stolen,omitempty"`
	BlocksEndorsed     *int                         `json:"blocks_endorsed,omitempty"`
	SlotsEndorsed      *int                         `json:"slots_endorsed,omitempty"`
	SlotsMissed        *int                         `json:"slots_missed,omitempty"`
	NOps               int                          `json:"n_ops"`
	NOpsFailed         int                          `json:"n_ops_failed"`
	NTx                int                          `json:"n_tx"`
	NDelegation        int                          `json:"n_delegation"`
	NOrigination       int                          `json:"n_origination"`
	NProposal          *int                         `json:"n_proposal,omitempty"`
	NBallot            *int                         `json:"n_ballot,omitempty"`
	TokenGenMin        int64                        `json:"token_gen_min"`
	TokenGenMax        int64                        `json:"token_gen_max"`
	GracePeriod        *int64                       `json:"grace_period,omitempty"`
	StakingBalance     *float64                     `json:"staking_balance,omitempty"`
	StakingCapacity    *float64                     `json:"staking_capacity,omitempty"`
	Rolls              *int64                       `json:"rolls,omitempty"`
	LastBakeHeight     *int64                       `json:"last_bake_height,omitempty"`
	LastBakeBlock      *string                      `json:"last_bake_block,omitempty"`
	LastBakeTime       *time.Time                   `json:"last_bake_time,omitempty"`
	LastEndorseHeight  *int64                       `json:"last_endorse_height,omitempty"`
	LastEndorseBlock   *string                      `json:"last_endorse_block,omitempty"`
	LastEndorseTime    *time.Time                   `json:"last_endorse_time,omitempty"`
	NextBakeHeight     *int64                       `json:"next_bake_height,omitempty"`
	NextBakePriority   *int                         `json:"next_bake_priority,omitempty"`
	NextBakeTime       *time.Time                   `json:"next_bake_time,omitempty"`
	NextEndorseHeight  *int64                       `json:"next_endorse_height,omitempty"`
	NextEndorseTime    *time.Time                   `json:"next_endorse_time,omitempty"`
	AvgLuck64          *int64                       `json:"avg_luck_64,omitempty"`
	AvgPerformance64   *int64                       `json:"avg_performance_64,omitempty"`
	AvgContribution64  *int64                       `json:"avg_contribution_64,omitempty"`
	BakerVersion       *string                      `json:"baker_version,omitempty"`
	Metadata           map[string]*ExplorerMetadata `json:"metadata,omitempty"`

	// LEGACY
	Ops     *ExplorerOpList   `json:"ops,omitempty"`
	Ballots []*ExplorerBallot `json:"ballots,omitempty"`
	// contains filtered or unexported fields
}

func NewExplorerAccount

func NewExplorerAccount(ctx *ApiContext, a *model.Account, args Options) *ExplorerAccount

func (ExplorerAccount) Expires

func (a ExplorerAccount) Expires() time.Time

func (ExplorerAccount) LastModified

func (a ExplorerAccount) LastModified() time.Time

func (ExplorerAccount) RESTPath

func (a ExplorerAccount) RESTPath(r *mux.Router) string

func (ExplorerAccount) RESTPrefix

func (a ExplorerAccount) RESTPrefix() string

func (ExplorerAccount) RegisterDirectRoutes

func (b ExplorerAccount) RegisterDirectRoutes(r *mux.Router) error

func (ExplorerAccount) RegisterRoutes

func (b ExplorerAccount) RegisterRoutes(r *mux.Router) error

type ExplorerBaker

type ExplorerBaker struct {
	Id                model.AccountID   `json:"id"`
	Address           tezos.Address     `json:"address"`
	BakerSince        time.Time         `json:"baker_since_time"`
	BakerVersion      string            `json:"baker_version"`
	TotalBalance      float64           `json:"total_balance"`
	SpendableBalance  float64           `json:"spendable_balance"`
	FrozenDeposits    float64           `json:"frozen_deposits"`
	FrozenRewards     float64           `json:"frozen_rewards"`
	FrozenFees        float64           `json:"frozen_fees"`
	StakingBalance    float64           `json:"staking_balance"`
	StakingCapacity   float64           `json:"staking_capacity"`
	ActiveDelegations int64             `json:"active_delegations"`
	IsFull            bool              `json:"is_full"`
	Rolls             int64             `json:"rolls"`
	Share             float64           `json:"share"`
	AvgLuck64         int64             `json:"avg_luck_64"`
	AvgPerformance64  int64             `json:"avg_performance_64"`
	AvgContribution64 int64             `json:"avg_contribution_64"`
	Metadata          *ExplorerMetadata `json:"metadata,omitempty"`
}

type ExplorerBallot

type ExplorerBallot struct {
	RowId            uint64                 `json:"row_id"`
	Height           int64                  `json:"height"`
	Timestamp        time.Time              `json:"time"`
	ElectionId       int                    `json:"election_id"`
	VotingPeriod     int64                  `json:"voting_period"`
	VotingPeriodKind tezos.VotingPeriodKind `json:"voting_period_kind"`
	Proposal         tezos.ProtocolHash     `json:"proposal"`
	OpHash           tezos.OpHash           `json:"op"`
	Ballot           tezos.BallotVote       `json:"ballot"`
	Rolls            int64                  `json:"rolls"`
	Sender           string                 `json:"sender"`
}

func NewExplorerBallot

func NewExplorerBallot(ctx *ApiContext, b *model.Ballot, p tezos.ProtocolHash, o tezos.OpHash) *ExplorerBallot

type ExplorerBallotList

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

func (ExplorerBallotList) Expires

func (l ExplorerBallotList) Expires() time.Time

func (ExplorerBallotList) LastModified

func (l ExplorerBallotList) LastModified() time.Time

func (ExplorerBallotList) MarshalJSON

func (l ExplorerBallotList) MarshalJSON() ([]byte, error)

type ExplorerBigmap

type ExplorerBigmap struct {
	Contract      tezos.Address     `json:"contract"`
	BigmapId      int64             `json:"bigmap_id"`
	NUpdates      int64             `json:"n_updates"`
	NKeys         int64             `json:"n_keys"`
	AllocHeight   int64             `json:"alloc_height"`
	AllocBlock    tezos.BlockHash   `json:"alloc_block"`
	AllocTime     time.Time         `json:"alloc_time"`
	UpdatedHeight int64             `json:"update_height"`
	UpdatedBlock  tezos.BlockHash   `json:"update_block"`
	UpdatedTime   time.Time         `json:"update_time"`
	KeyType       micheline.Typedef `json:"key_type"`
	ValueType     micheline.Typedef `json:"value_type"`
	KeyTypePrim   *micheline.Prim   `json:"key_type_prim,omitempty"`
	ValueTypePrim *micheline.Prim   `json:"value_type_prim,omitempty"`
	// contains filtered or unexported fields
}

func NewExplorerBigmap

func NewExplorerBigmap(ctx *ApiContext, alloc *model.BigmapAlloc, args Options) *ExplorerBigmap

func (ExplorerBigmap) Expires

func (b ExplorerBigmap) Expires() time.Time

func (ExplorerBigmap) LastModified

func (b ExplorerBigmap) LastModified() time.Time

func (ExplorerBigmap) RESTPath

func (b ExplorerBigmap) RESTPath(r *mux.Router) string

func (ExplorerBigmap) RESTPrefix

func (b ExplorerBigmap) RESTPrefix() string

func (ExplorerBigmap) RegisterDirectRoutes

func (b ExplorerBigmap) RegisterDirectRoutes(r *mux.Router) error

func (ExplorerBigmap) RegisterRoutes

func (b ExplorerBigmap) RegisterRoutes(r *mux.Router) error

type ExplorerBigmapKey

type ExplorerBigmapKey struct {
	Key     micheline.Key       `json:"key"`
	KeyHash tezos.ExprHash      `json:"key_hash"`
	Meta    *ExplorerBigmapMeta `json:"meta,omitempty"`
	Prim    *micheline.Prim     `json:"prim,omitempty"`
}

keys

type ExplorerBigmapKeyList

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

func (ExplorerBigmapKeyList) Expires

func (l ExplorerBigmapKeyList) Expires() time.Time

func (ExplorerBigmapKeyList) LastModified

func (l ExplorerBigmapKeyList) LastModified() time.Time

func (ExplorerBigmapKeyList) MarshalJSON

func (l ExplorerBigmapKeyList) MarshalJSON() ([]byte, error)

type ExplorerBigmapMeta

type ExplorerBigmapMeta struct {
	Contract     tezos.Address    `json:"contract"`
	BigmapId     int64            `json:"bigmap_id"`
	UpdateTime   *time.Time       `json:"time,omitempty"`
	UpdateHeight int64            `json:"height,omitempty"`
	UpdateBlock  *tezos.BlockHash `json:"block,omitempty"`
	UpdateOp     *tezos.OpHash    `json:"op,omitempty"`
	Sender       *tezos.Address   `json:"sender,omitempty"`
	Source       *tezos.Address   `json:"source,omitempty"`
}

bigmap metadata

type ExplorerBigmapUpdate

type ExplorerBigmapUpdate struct {
	ExplorerBigmapValue                      // full value
	Action              micheline.DiffAction `json:"action"`
	BigmapId            int64                `json:"bigmap_id"`

	// alloc/copy
	KeyType       *micheline.Typedef `json:"key_type,omitempty"`
	ValueType     *micheline.Typedef `json:"value_type,omitempty"`
	KeyTypePrim   *micheline.Prim    `json:"key_type_prim,omitempty"`
	ValueTypePrim *micheline.Prim    `json:"value_type_prim,omitempty"`
	SourceId      int64              `json:"source_big_map,omitempty"`
	DestId        int64              `json:"destination_big_map,omitempty"`
}

updates

type ExplorerBigmapUpdateList

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

func (ExplorerBigmapUpdateList) Expires

func (l ExplorerBigmapUpdateList) Expires() time.Time

func (ExplorerBigmapUpdateList) LastModified

func (l ExplorerBigmapUpdateList) LastModified() time.Time

func (ExplorerBigmapUpdateList) MarshalJSON

func (l ExplorerBigmapUpdateList) MarshalJSON() ([]byte, error)

type ExplorerBigmapValue

type ExplorerBigmapValue struct {
	Key       *micheline.Key      `json:"key,omitempty"`
	KeyHash   *tezos.ExprHash     `json:"key_hash,omitempty"`
	Value     *micheline.Value    `json:"value,omitempty"` // omit on removal updates
	Meta      *ExplorerBigmapMeta `json:"meta,omitempty"`
	KeyPrim   *micheline.Prim     `json:"key_prim,omitempty"`
	ValuePrim *micheline.Prim     `json:"value_prim,omitempty"`
	// contains filtered or unexported fields
}

values

func (ExplorerBigmapValue) Expires

func (t ExplorerBigmapValue) Expires() time.Time

func (ExplorerBigmapValue) LastModified

func (t ExplorerBigmapValue) LastModified() time.Time

type ExplorerBigmapValueList

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

func (ExplorerBigmapValueList) Expires

func (l ExplorerBigmapValueList) Expires() time.Time

func (ExplorerBigmapValueList) LastModified

func (l ExplorerBigmapValueList) LastModified() time.Time

func (ExplorerBigmapValueList) MarshalJSON

func (l ExplorerBigmapValueList) MarshalJSON() ([]byte, error)

type ExplorerBlock

type ExplorerBlock struct {
	Hash                tezos.BlockHash              `json:"hash"`
	ParentHash          tezos.BlockHash              `json:"predecessor"`
	FollowerHash        tezos.BlockHash              `json:"successor"`
	Baker               tezos.Address                `json:"baker"`
	IsOrphan            bool                         `json:"is_orphan,omitempty"`
	Height              int64                        `json:"height"`
	Cycle               int64                        `json:"cycle"`
	IsCycleSnapshot     bool                         `json:"is_cycle_snapshot"`
	Timestamp           time.Time                    `json:"time"`
	Solvetime           int                          `json:"solvetime"`
	Version             int                          `json:"version"`
	Validation          int                          `json:"validation_pass"`
	Fitness             uint64                       `json:"fitness"`
	Priority            int                          `json:"priority"`
	Nonce               string                       `json:"nonce"`
	VotingPeriodKind    tezos.VotingPeriodKind       `json:"voting_period_kind"`
	SlotMask            string                       `json:"slot_mask"`
	NSlotsEndorsed      int                          `json:"n_endorsed_slots"`
	NOps                int                          `json:"n_ops"`
	NOpsFailed          int                          `json:"n_ops_failed"`
	NOpsContract        int                          `json:"n_ops_contract"`
	NTx                 int                          `json:"n_tx"`
	NActivation         int                          `json:"n_activation"`
	NSeedNonce          int                          `json:"n_seed_nonce_revelations"`
	N2Baking            int                          `json:"n_double_baking_evidences"`
	N2Endorsement       int                          `json:"n_double_endorsement_evidences"`
	NEndorsement        int                          `json:"n_endorsement"`
	NDelegation         int                          `json:"n_delegation"`
	NReveal             int                          `json:"n_reveal"`
	NOrigination        int                          `json:"n_origination"`
	NProposal           int                          `json:"n_proposal"`
	NBallot             int                          `json:"n_ballot"`
	Volume              float64                      `json:"volume"`
	Fee                 float64                      `json:"fee"`
	Reward              float64                      `json:"reward"`
	Deposit             float64                      `json:"deposit"`
	UnfrozenFees        float64                      `json:"unfrozen_fees"`
	UnfrozenRewards     float64                      `json:"unfrozen_rewards"`
	UnfrozenDeposits    float64                      `json:"unfrozen_deposits"`
	ActivatedSupply     float64                      `json:"activated_supply"`
	BurnedSupply        float64                      `json:"burned_supply"`
	SeenAccounts        int                          `json:"n_accounts"`
	NewAccounts         int                          `json:"n_new_accounts"`
	NewImplicitAccounts int                          `json:"n_new_implicit"`
	NewManagedAccounts  int                          `json:"n_new_managed"`
	NewContracts        int                          `json:"n_new_contracts"`
	ClearedAccounts     int                          `json:"n_cleared_accounts"`
	FundedAccounts      int                          `json:"n_funded_accounts"`
	GasLimit            int64                        `json:"gas_limit"`
	GasUsed             int64                        `json:"gas_used"`
	GasPrice            float64                      `json:"gas_price"`
	StorageSize         int64                        `json:"storage_size"`
	TDD                 float64                      `json:"days_destroyed"`
	PctAccountsReused   float64                      `json:"pct_account_reuse"`
	NOpsImplicit        int                          `json:"n_ops_implicit"`
	LbEscapeVote        bool                         `json:"lb_esc_vote"`
	LbEscapeEma         int64                        `json:"lb_esc_ema"`
	Metadata            map[string]*ExplorerMetadata `json:"metadata,omitempty"`
	Rights              []ExplorerRight              `json:"rights,omitempty"`

	// LEGACY
	Ops *ExplorerOpList `json:"ops,omitempty"`
	// contains filtered or unexported fields
}

func NewExplorerBlock

func NewExplorerBlock(ctx *ApiContext, block *model.Block, args Options) *ExplorerBlock

func (ExplorerBlock) Expires

func (b ExplorerBlock) Expires() time.Time

func (ExplorerBlock) LastModified

func (b ExplorerBlock) LastModified() time.Time

func (ExplorerBlock) RESTPath

func (b ExplorerBlock) RESTPath(r *mux.Router) string

func (ExplorerBlock) RESTPrefix

func (b ExplorerBlock) RESTPrefix() string

func (ExplorerBlock) RegisterDirectRoutes

func (b ExplorerBlock) RegisterDirectRoutes(r *mux.Router) error

func (ExplorerBlock) RegisterRoutes

func (b ExplorerBlock) RegisterRoutes(r *mux.Router) error

type ExplorerContract

type ExplorerContract struct {
	Address       string                       `json:"address"`
	Creator       string                       `json:"creator"`
	Delegate      string                       `json:"delegate"`
	StorageSize   int64                        `json:"storage_size"`
	StoragePaid   int64                        `json:"storage_paid"`
	FirstSeen     int64                        `json:"first_seen"`
	LastSeen      int64                        `json:"last_seen"`
	FirstSeenTime time.Time                    `json:"first_seen_time"`
	LastSeenTime  time.Time                    `json:"last_seen_time"`
	NOps          int                          `json:"n_ops"`
	NOpsFailed    int                          `json:"n_ops_failed"`
	Bigmaps       map[string]int64             `json:"bigmaps,omitempty"`
	InterfaceHash string                       `json:"iface_hash"`
	CodeHash      string                       `json:"code_hash"`
	CallStats     map[string]int               `json:"call_stats"`
	Features      micheline.Features           `json:"features"`
	Interfaces    micheline.Interfaces         `json:"interfaces"`
	Metadata      map[string]*ExplorerMetadata `json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

func NewExplorerContract

func NewExplorerContract(ctx *ApiContext, c *model.Contract, a *model.Account, args Options) *ExplorerContract

func (ExplorerContract) Expires

func (a ExplorerContract) Expires() time.Time

func (ExplorerContract) LastModified

func (a ExplorerContract) LastModified() time.Time

func (ExplorerContract) RESTPath

func (a ExplorerContract) RESTPath(r *mux.Router) string

func (ExplorerContract) RESTPrefix

func (a ExplorerContract) RESTPrefix() string

func (ExplorerContract) RegisterDirectRoutes

func (b ExplorerContract) RegisterDirectRoutes(r *mux.Router) error

func (ExplorerContract) RegisterRoutes

func (b ExplorerContract) RegisterRoutes(r *mux.Router) error

type ExplorerCycle

type ExplorerCycle struct {
	Cycle       int64     `json:"cycle"`
	StartHeight int64     `json:"start_height"`
	EndHeight   int64     `json:"end_height"`
	StartTime   time.Time `json:"start_time"`
	EndTime     time.Time `json:"end_time"`
	Progress    float64   `json:"progress"`
	IsComplete  bool      `json:"is_complete"` // all blocks baked, cycle complete
	IsSnapshot  bool      `json:"is_snapshot"` // snapshot and rights for cycle N+7 exist
	IsActive    bool      `json:"is_active"`   // cycle is in progress

	// this cycle staking data (at snapshot block or last available block)
	SnapshotHeight   int64     `json:"snapshot_height"` // -1 when no snapshot
	SnapshotIndex    int64     `json:"snapshot_index"`  // -1 when no snapshot
	SnapshotTime     time.Time `json:"snapshot_time"`   // zero when no snapshot
	Rolls            int64     `json:"rolls"`
	RollOwners       int64     `json:"roll_owners"`
	ActiveDelegators int64     `json:"active_delegators"`
	ActiveBakers     int64     `json:"active_bakers"`
	StakingSupply    float64   `json:"staking_supply"`
	StakingPercent   float64   `json:"staking_percent"` // of total supply

	// health data across all blocks in cycle (empty for future cycles)
	WorkingBakers      int     `json:"working_bakers"`
	WorkingEndorsers   int     `json:"working_endorsers"` // from ops
	MissedPriorities   int     `json:"missed_priorities"`
	MissedEndorsements int     `json:"missed_endorsements"`
	N2Baking           int     `json:"n_double_baking"`
	N2Endorsement      int     `json:"n_double_endorsement"`
	NOrphans           int     `json:"n_orphans"`
	SolveTimeMin       int64   `json:"solvetime_min"`
	SolveTimeMax       int64   `json:"solvetime_max"`
	SolveTimeMean      float64 `json:"solvetime_mean"`
	PriorityMin        int64   `json:"priority_min"`
	PriorityMax        int64   `json:"priority_max"`
	PriorityMean       float64 `json:"priority_mean"`
	EndorsementRate    float64 `json:"endorsement_rate"`
	EndorsementsMin    int64   `json:"endorsements_min"`
	EndorsementsMax    int64   `json:"endorsements_max"`
	EndorsementsMean   float64 `json:"endorsements_mean"`
	SeedNonceRate      float64 `json:"seed_rate"` // from ops
	WorstBakedBlock    int64   `json:"worst_baked_block"`
	WorstEndorsedBlock int64   `json:"worst_endorsed_block"`

	// snapshot cycle who defined rights for this cycle
	SnapshotCycle *ExplorerCycle `json:"snapshot_cycle,omitempty"`

	// future cycle who's rights are defined by this cycle
	FollowerCycle *ExplorerCycle `json:"follower_cycle,omitempty"`
	// contains filtered or unexported fields
}

func NewExplorerCycle

func NewExplorerCycle(ctx *ApiContext, id int64) *ExplorerCycle

func (ExplorerCycle) Expires

func (c ExplorerCycle) Expires() time.Time

func (ExplorerCycle) LastModified

func (c ExplorerCycle) LastModified() time.Time

func (ExplorerCycle) RESTPath

func (c ExplorerCycle) RESTPath(r *mux.Router) string

func (ExplorerCycle) RESTPrefix

func (c ExplorerCycle) RESTPrefix() string

func (ExplorerCycle) RegisterDirectRoutes

func (c ExplorerCycle) RegisterDirectRoutes(r *mux.Router) error

func (ExplorerCycle) RegisterRoutes

func (c ExplorerCycle) RegisterRoutes(r *mux.Router) error

type ExplorerElection

type ExplorerElection struct {
	Id                int                    `json:"election_id"`
	MaxPeriods        int                    `json:"max_periods"`
	NumPeriods        int                    `json:"num_periods"`
	NumProposals      int                    `json:"num_proposals"`
	StartTime         time.Time              `json:"start_time"`
	EndTime           time.Time              `json:"end_time"`
	StartHeight       int64                  `json:"start_height"`
	EndHeight         int64                  `json:"end_height"`
	IsEmpty           bool                   `json:"is_empty"`
	IsOpen            bool                   `json:"is_open"`
	IsFailed          bool                   `json:"is_failed"`
	NoQuorum          bool                   `json:"no_quorum"`
	NoMajority        bool                   `json:"no_majority"`
	NoProposal        bool                   `json:"no_proposal"`
	VotingPeriodKind  tezos.VotingPeriodKind `json:"voting_period"`
	ProposalPeriod    *ExplorerVote          `json:"proposal"`
	ExplorationPeriod *ExplorerVote          `json:"exploration"`
	CooldownPeriod    *ExplorerVote          `json:"cooldown"`
	PromotionPeriod   *ExplorerVote          `json:"promotion"`
	AdoptionPeriod    *ExplorerVote          `json:"adoption"`
	// contains filtered or unexported fields
}

func NewExplorerElection

func NewExplorerElection(ctx *ApiContext, e *model.Election) *ExplorerElection

func (ExplorerElection) Expires

func (b ExplorerElection) Expires() time.Time

func (ExplorerElection) LastModified

func (b ExplorerElection) LastModified() time.Time

func (ExplorerElection) RESTPath

func (b ExplorerElection) RESTPath(r *mux.Router) string

func (ExplorerElection) RESTPrefix

func (b ExplorerElection) RESTPrefix() string

func (ExplorerElection) RegisterDirectRoutes

func (b ExplorerElection) RegisterDirectRoutes(r *mux.Router) error

func (ExplorerElection) RegisterRoutes

func (b ExplorerElection) RegisterRoutes(r *mux.Router) error

type ExplorerMetadata

type ExplorerMetadata struct {
	// unique identity
	Address   tezos.Address   // must be valid
	AssetId   *int64          // may be 0
	AccountId model.AccountID // may be 0 for non-indexed accounts
	RowId     uint64          // metadata entry id (used for update/insert)

	// input only
	Parsed map[string]json.RawMessage

	// output only
	Raw []byte

	// filtered properties
	Name           string
	Description    string
	IsValidator    bool
	Country        iso.Country
	Kind           string
	Status         string
	Symbol         string
	Standard       string
	MinDelegation  float64
	NonDelegatable bool
}

func NewExplorerMetadata

func NewExplorerMetadata(m *model.Metadata) *ExplorerMetadata

func (*ExplorerMetadata) Equal

func (m *ExplorerMetadata) Equal(x *ExplorerMetadata) bool

func (ExplorerMetadata) Expires

func (a ExplorerMetadata) Expires() time.Time

func (ExplorerMetadata) LastModified

func (a ExplorerMetadata) LastModified() time.Time

func (ExplorerMetadata) MarshalJSON

func (m ExplorerMetadata) MarshalJSON() ([]byte, error)

func (ExplorerMetadata) RESTPath

func (a ExplorerMetadata) RESTPath(r *mux.Router) string

func (ExplorerMetadata) RESTPrefix

func (a ExplorerMetadata) RESTPrefix() string

func (ExplorerMetadata) RegisterDirectRoutes

func (a ExplorerMetadata) RegisterDirectRoutes(r *mux.Router) error

func (ExplorerMetadata) RegisterRoutes

func (b ExplorerMetadata) RegisterRoutes(r *mux.Router) error

func (ExplorerMetadata) StringKey

func (m ExplorerMetadata) StringKey() string

func (ExplorerMetadata) Uint64Key

func (m ExplorerMetadata) Uint64Key() uint64

func (*ExplorerMetadata) UnmarshalJSON

func (m *ExplorerMetadata) UnmarshalJSON(buf []byte) error

func (*ExplorerMetadata) Validate

func (m *ExplorerMetadata) Validate(ctx *ApiContext) error

type ExplorerOp

type ExplorerOp struct {
	RowId         model.OpID                   `json:"row_id,omitempty"`
	Hash          tezos.OpHash                 `json:"hash,omitempty"`
	Type          tezos.OpType                 `json:"type"`
	BlockHash     tezos.BlockHash              `json:"block"`
	Timestamp     time.Time                    `json:"time"`
	Height        int64                        `json:"height"`
	Cycle         int64                        `json:"cycle"`
	Counter       int64                        `json:"counter"`
	OpL           int                          `json:"op_l"`
	OpP           int                          `json:"op_p"`
	OpC           int                          `json:"op_c"`
	OpI           int                          `json:"op_i"`
	Status        string                       `json:"status"`
	IsSuccess     bool                         `json:"is_success"`
	IsContract    bool                         `json:"is_contract"`
	GasLimit      int64                        `json:"gas_limit"`
	GasUsed       int64                        `json:"gas_used"`
	GasPrice      float64                      `json:"gas_price"`
	StorageLimit  int64                        `json:"storage_limit"`
	StorageSize   int64                        `json:"storage_size"`
	StoragePaid   int64                        `json:"storage_paid"`
	Volume        float64                      `json:"volume"`
	Fee           float64                      `json:"fee"`
	Reward        float64                      `json:"reward,omitempty"`
	Deposit       float64                      `json:"deposit,omitempty"`
	Burned        float64                      `json:"burned,omitempty"`
	IsInternal    bool                         `json:"is_internal,omitempty"`
	HasData       bool                         `json:"has_data,omitempty"`
	TDD           float64                      `json:"days_destroyed"`
	Data          json.RawMessage              `json:"data,omitempty"`
	Errors        json.RawMessage              `json:"errors,omitempty"`
	Parameters    *ExplorerParameters          `json:"parameters,omitempty"`
	Storage       *ExplorerStorageValue        `json:"storage,omitempty"`
	BigmapDiff    *ExplorerBigmapUpdateList    `json:"big_map_diff,omitempty"`
	Sender        *tezos.Address               `json:"sender,omitempty"`
	Receiver      *tezos.Address               `json:"receiver,omitempty"`
	Creator       *tezos.Address               `json:"creator,omitempty"`
	Delegate      *tezos.Address               `json:"delegate,omitempty"`
	BranchHeight  int64                        `json:"branch_height,omitempty"`
	BranchDepth   int64                        `json:"branch_depth,omitempty"`
	BranchHash    *tezos.BlockHash             `json:"branch_hash,omitempty"`
	IsImplicit    bool                         `json:"is_implicit,omitempty"`
	EntrypointId  *int                         `json:"entrypoint_id,omitempty"`
	Entrypoint    string                       `json:"entrypoint,omitempty"`
	IsOrphan      bool                         `json:"is_orphan,omitempty"`
	IsBatch       bool                         `json:"is_batch,omitempty"`
	IsSapling     bool                         `json:"is_sapling,omitempty"`
	BatchVolume   float64                      `json:"batch_volume,omitempty"`
	Metadata      map[string]*ExplorerMetadata `json:"metadata,omitempty"`
	Batch         []*ExplorerOp                `json:"batch,omitempty"`
	Internal      []*ExplorerOp                `json:"internal,omitempty"`
	NOps          int                          `json:"n_ops,omitempty"`
	Confirmations int64                        `json:"confirmations"`
	// contains filtered or unexported fields
}

func NewExplorerOp

func NewExplorerOp(ctx *ApiContext, op *model.Op, block *model.Block, cc *model.Contract, args Options, cache map[int64]interface{}) *ExplorerOp

func WrapAsBatchOp

func WrapAsBatchOp(op *ExplorerOp) *ExplorerOp

func (ExplorerOp) Expires

func (o ExplorerOp) Expires() time.Time

func (ExplorerOp) LastModified

func (o ExplorerOp) LastModified() time.Time

func (ExplorerOp) RESTPath

func (o ExplorerOp) RESTPath(r *mux.Router) string

func (ExplorerOp) RESTPrefix

func (o ExplorerOp) RESTPrefix() string

func (ExplorerOp) RegisterDirectRoutes

func (o ExplorerOp) RegisterDirectRoutes(r *mux.Router) error

func (ExplorerOp) RegisterRoutes

func (t ExplorerOp) RegisterRoutes(r *mux.Router) error

type ExplorerOpList

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

func (*ExplorerOpList) Append

func (l *ExplorerOpList) Append(op *ExplorerOp, collapsed bool)

func (ExplorerOpList) Expires

func (l ExplorerOpList) Expires() time.Time

func (ExplorerOpList) LastModified

func (t ExplorerOpList) LastModified() time.Time

func (ExplorerOpList) MarshalJSON

func (l ExplorerOpList) MarshalJSON() ([]byte, error)

func (ExplorerOpList) RESTPath

func (t ExplorerOpList) RESTPath(r *mux.Router) string

func (ExplorerOpList) RESTPrefix

func (t ExplorerOpList) RESTPrefix() string

func (ExplorerOpList) RegisterDirectRoutes

func (t ExplorerOpList) RegisterDirectRoutes(r *mux.Router) error

func (ExplorerOpList) RegisterRoutes

func (t ExplorerOpList) RegisterRoutes(r *mux.Router) error

type ExplorerParameters

type ExplorerParameters struct {
	Entrypoint string          `json:"entrypoint"`
	Call       string          `json:"call"`
	Branch     string          `json:"branch"`
	Id         int             `json:"id"`
	Value      micheline.Value `json:"value"`
	Prim       *micheline.Prim `json:"prim,omitempty"`
}

params

type ExplorerProposal

type ExplorerProposal struct {
	Hash          tezos.ProtocolHash `json:"hash"`
	SourceAddress tezos.Address      `json:"source"`
	BlockHash     tezos.BlockHash    `json:"block_hash"`
	OpHash        tezos.OpHash       `json:"op_hash"`
	Height        int64              `json:"height"`
	Time          time.Time          `json:"time"`
	Rolls         int64              `json:"rolls"`
	Voters        int64              `json:"voters"`
}

func NewExplorerProposal

func NewExplorerProposal(ctx *ApiContext, p *model.Proposal) *ExplorerProposal

type ExplorerRight

type ExplorerRight struct {
	Type           tezos.RightType `json:"type"`
	Priority       *int            `json:"priority,omitempty"`
	Slots          []int           `json:"slots,omitempty"`
	AccountId      model.AccountID `json:"-"`
	Address        tezos.Address   `json:"address"`
	IsUsed         *bool           `json:"is_used,omitempty"`
	IsLost         *bool           `json:"is_lost,omitempty"`
	IsStolen       *bool           `json:"is_stolen,omitempty"`
	IsMissed       *bool           `json:"is_missed,omitempty"`
	IsBondMiss     *bool           `json:"is_bond_miss,omitempty"`
	IsSeedRequired *bool           `json:"is_seed_required,omitempty"`
	IsSeedRevealed *bool           `json:"is_seed_revealed,omitempty"`
}

func NewExplorerRight

func NewExplorerRight(ctx *ApiContext, r model.Right) ExplorerRight

type ExplorerScript

type ExplorerScript struct {
	Script      *micheline.Script     `json:"script,omitempty"`
	Type        micheline.Typedef     `json:"storage_type"`
	Entrypoints micheline.Entrypoints `json:"entrypoints"`
	Bigmaps     map[string]int64      `json:"bigmaps,omitempty"`
	// contains filtered or unexported fields
}

func (ExplorerScript) Expires

func (s ExplorerScript) Expires() time.Time

func (ExplorerScript) LastModified

func (s ExplorerScript) LastModified() time.Time

type ExplorerStorageMeta

type ExplorerStorageMeta struct {
	Contract tezos.Address   `json:"contract"`
	Time     time.Time       `json:"time"`
	Height   int64           `json:"height"`
	Block    tezos.BlockHash `json:"block"`
}

storage metadata

type ExplorerStorageValue

type ExplorerStorageValue struct {
	Meta    *ExplorerStorageMeta `json:"meta,omitempty"`
	Value   micheline.Value      `json:"value"`
	Prim    *micheline.Prim      `json:"prim,omitempty"`
	Bigmaps map[string]int64     `json:"bigmaps,omitempty"` // for ContractStorage
	// contains filtered or unexported fields
}

storage

func (ExplorerStorageValue) Expires

func (t ExplorerStorageValue) Expires() time.Time

func (ExplorerStorageValue) LastModified

func (t ExplorerStorageValue) LastModified() time.Time

type ExplorerVote

type ExplorerVote struct {
	VotingPeriod     int64                  `json:"voting_period"`
	VotingPeriodKind tezos.VotingPeriodKind `json:"voting_period_kind"`
	StartTime        time.Time              `json:"period_start_time"`
	EndTime          time.Time              `json:"period_end_time"`
	StartHeight      int64                  `json:"period_start_block"`
	EndHeight        int64                  `json:"period_end_block"`
	EligibleRolls    int64                  `json:"eligible_rolls"`
	EligibleVoters   int64                  `json:"eligible_voters"`
	QuorumPct        int64                  `json:"quorum_pct"`
	QuorumRolls      int64                  `json:"quorum_rolls"`
	TurnoutRolls     int64                  `json:"turnout_rolls"`
	TurnoutVoters    int64                  `json:"turnout_voters"`
	TurnoutPct       int64                  `json:"turnout_pct"`
	TurnoutEma       int64                  `json:"turnout_ema"`
	YayRolls         int64                  `json:"yay_rolls"`
	YayVoters        int64                  `json:"yay_voters"`
	NayRolls         int64                  `json:"nay_rolls"`
	NayVoters        int64                  `json:"nay_voters"`
	PassRolls        int64                  `json:"pass_rolls"`
	PassVoters       int64                  `json:"pass_voters"`
	IsOpen           bool                   `json:"is_open"`
	IsFailed         bool                   `json:"is_failed"`
	IsDraw           bool                   `json:"is_draw"`
	NoProposal       bool                   `json:"no_proposal"`
	NoQuorum         bool                   `json:"no_quorum"`
	NoMajority       bool                   `json:"no_majority"`
	Proposals        []*ExplorerProposal    `json:"proposals"`
}

func NewExplorerVote

func NewExplorerVote(ctx *ApiContext, v *model.Vote) *ExplorerVote

type ExplorerVoter

type ExplorerVoter struct {
	RowId     model.AccountID      `json:"row_id"`
	Address   tezos.Address        `json:"address"`
	Rolls     int64                `json:"rolls"`
	Stake     int64                `json:"stake"`
	HasVoted  bool                 `json:"has_voted"`
	Ballot    tezos.BallotVote     `json:"ballot,omitempty"`
	Proposals []tezos.ProtocolHash `json:"proposals,omitempty"`
}

func NewExplorerVoter

func NewExplorerVoter(ctx *ApiContext, v *model.Voter) *ExplorerVoter

type ExplorerVoterList

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

func (ExplorerVoterList) Expires

func (l ExplorerVoterList) Expires() time.Time

func (ExplorerVoterList) LastModified

func (l ExplorerVoterList) LastModified() time.Time

func (ExplorerVoterList) MarshalJSON

func (l ExplorerVoterList) MarshalJSON() ([]byte, error)

type FillMode

type FillMode string
const (
	FillModeInvalid FillMode = ""
	FillModeNone    FillMode = "none"
	FillModeNull    FillMode = "null"
	FillModeLast    FillMode = "last"
	FillModeLinear  FillMode = "linear"
	FillModeZero    FillMode = "zero"
)

func ParseFillMode

func ParseFillMode(s string) FillMode

func (FillMode) IsValid

func (m FillMode) IsValid() bool

func (FillMode) MarshalText

func (m FillMode) MarshalText() ([]byte, error)

func (FillMode) String

func (m FillMode) String() string

func (*FillMode) UnmarshalText

func (m *FillMode) UnmarshalText(data []byte) error

type Flow

type Flow struct {
	model.Flow
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*Flow) MarshalCSV

func (f *Flow) MarshalCSV() ([]string, error)

func (*Flow) MarshalJSON

func (f *Flow) MarshalJSON() ([]byte, error)

func (*Flow) MarshalJSONBrief

func (f *Flow) MarshalJSONBrief() ([]byte, error)

func (*Flow) MarshalJSONVerbose

func (f *Flow) MarshalJSONVerbose() ([]byte, error)

type FlowSeries

type FlowSeries struct {
	Timestamp time.Time `json:"time"`
	Count     int       `json:"count"`
	AmountIn  int64     `json:"amount_in"`
	AmountOut int64     `json:"amount_out"`
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*FlowSeries) Add

func (s *FlowSeries) Add(m SeriesModel)

func (*FlowSeries) BuildQuery

func (s *FlowSeries) BuildQuery(ctx *ApiContext, args *SeriesRequest) pack.Query

func (*FlowSeries) Clone

func (s *FlowSeries) Clone() SeriesBucket

func (*FlowSeries) Init

func (s *FlowSeries) Init(params *tezos.Params, columns []string, verbose bool)

func (*FlowSeries) Interpolate

func (s *FlowSeries) Interpolate(m SeriesBucket, ts time.Time) SeriesBucket

func (*FlowSeries) IsEmpty

func (s *FlowSeries) IsEmpty() bool

func (*FlowSeries) MarshalCSV

func (f *FlowSeries) MarshalCSV() ([]string, error)

func (*FlowSeries) MarshalJSON

func (f *FlowSeries) MarshalJSON() ([]byte, error)

func (*FlowSeries) MarshalJSONBrief

func (f *FlowSeries) MarshalJSONBrief() ([]byte, error)

func (*FlowSeries) MarshalJSONVerbose

func (f *FlowSeries) MarshalJSONVerbose() ([]byte, error)

func (*FlowSeries) Null

func (s *FlowSeries) Null(ts time.Time) SeriesBucket

func (*FlowSeries) Reset

func (s *FlowSeries) Reset()

func (*FlowSeries) SetTime

func (s *FlowSeries) SetTime(ts time.Time) SeriesBucket

func (*FlowSeries) Time

func (s *FlowSeries) Time() time.Time

func (*FlowSeries) Zero

func (s *FlowSeries) Zero(ts time.Time) SeriesBucket

type HttpConfig

type HttpConfig struct {
	Addr                string        `json:"addr"`
	Port                int           `json:"port"`
	Scheme              string        `json:"scheme"`
	Host                string        `json:"host"`
	MaxWorkers          int           `json:"max_workers"`
	MaxQueue            int           `json:"max_queue"`
	ReadTimeout         time.Duration `json:"read_timeout"`
	HeaderTimeout       time.Duration `json:"header_timeout"`
	WriteTimeout        time.Duration `json:"write_timeout"`
	KeepAlive           time.Duration `json:"keep_alive"`
	ShutdownTimeout     time.Duration `json:"shutdown_timeout"`
	DefaultListCount    uint          `json:"default_list_count"`
	MaxListCount        uint          `json:"max_list_count"`
	DefaultExploreCount uint          `json:"default_explore_count"`
	MaxExploreCount     uint          `json:"max_explore_count"`
	MaxSeriesDuration   time.Duration `json:"max_series_duration"`
	CorsEnable          bool          `json:"cors_enable"`
	CorsOrigin          string        `json:"cors_origin"`
	CorsAllowHeaders    string        `json:"cors_allow_headers"`
	CorsExposeHeaders   string        `json:"cors_expose_headers"`
	CorsMethods         string        `json:"cors_methods"`
	CorsMaxAge          string        `json:"cors_maxage"`
	CorsCredentials     string        `json:"cors_credentials"`
	CacheEnable         bool          `json:"cache_enable"`
	CacheControl        string        `json:"cache_control"`
}

HTTP Server Configuration

func NewHttpConfig

func NewHttpConfig() HttpConfig

func (HttpConfig) Address

func (c HttpConfig) Address() string

func (*HttpConfig) Check

func (cfg *HttpConfig) Check() error

type Income

type Income struct {
	model.Income
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*Income) MarshalCSV

func (c *Income) MarshalCSV() ([]string, error)

func (*Income) MarshalJSON

func (r *Income) MarshalJSON() ([]byte, error)

func (*Income) MarshalJSONBrief

func (c *Income) MarshalJSONBrief() ([]byte, error)

func (*Income) MarshalJSONVerbose

func (c *Income) MarshalJSONVerbose() ([]byte, error)

type ListRequest

type ListRequest struct {
	Limit  uint           `schema:"limit"`
	Offset uint           `schema:"offset"`
	Cursor uint64         `schema:"cursor"`
	Order  pack.OrderType `schema:"order"`
}

generic list request

type MetadataListRequest

type MetadataListRequest struct {
	ListRequest
	Kind     *string      `schema:"kind"`
	Status   *string      `schema:"status"`
	Country  *iso.Country `schema:"country"`
	Standard *string      `schema:"standard"`
}

type Op

type Op struct {
	model.Op
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*Op) MarshalCSV

func (o *Op) MarshalCSV() ([]string, error)

func (*Op) MarshalJSON

func (o *Op) MarshalJSON() ([]byte, error)

func (*Op) MarshalJSONBrief

func (o *Op) MarshalJSONBrief() ([]byte, error)

func (*Op) MarshalJSONVerbose

func (o *Op) MarshalJSONVerbose() ([]byte, error)

type OpSeries

type OpSeries struct {
	Timestamp   time.Time `json:"time"`
	Count       int       `json:"count"`
	GasUsed     int64     `json:"gas_used"`
	StorageSize int64     `json:"storage_size"`
	StoragePaid int64     `json:"storage_paid"`
	Volume      int64     `json:"volume"`
	Fee         int64     `json:"fee"`
	Reward      int64     `json:"reward"`
	Deposit     int64     `json:"deposit"`
	Burned      int64     `json:"burned"`
	TDD         float64   `json:"days_destroyed"`
	// contains filtered or unexported fields
}

Only use fields that can be summed over time configurable marshalling helper

func (*OpSeries) Add

func (s *OpSeries) Add(m SeriesModel)

func (*OpSeries) BuildQuery

func (s *OpSeries) BuildQuery(ctx *ApiContext, args *SeriesRequest) pack.Query

func (*OpSeries) Clone

func (s *OpSeries) Clone() SeriesBucket

func (*OpSeries) Init

func (s *OpSeries) Init(params *tezos.Params, columns []string, verbose bool)

func (*OpSeries) Interpolate

func (s *OpSeries) Interpolate(m SeriesBucket, ts time.Time) SeriesBucket

func (*OpSeries) IsEmpty

func (s *OpSeries) IsEmpty() bool

func (*OpSeries) MarshalCSV

func (o *OpSeries) MarshalCSV() ([]string, error)

func (*OpSeries) MarshalJSON

func (s *OpSeries) MarshalJSON() ([]byte, error)

func (*OpSeries) MarshalJSONBrief

func (o *OpSeries) MarshalJSONBrief() ([]byte, error)

func (*OpSeries) MarshalJSONVerbose

func (o *OpSeries) MarshalJSONVerbose() ([]byte, error)

func (*OpSeries) Null

func (s *OpSeries) Null(ts time.Time) SeriesBucket

func (*OpSeries) Reset

func (s *OpSeries) Reset()

func (*OpSeries) SetTime

func (s *OpSeries) SetTime(ts time.Time) SeriesBucket

func (*OpSeries) Time

func (s *OpSeries) Time() time.Time

func (*OpSeries) Zero

func (s *OpSeries) Zero(ts time.Time) SeriesBucket

type OpsRequest

type OpsRequest struct {
	ListRequest // offset, limit, cursor, order

	Block    string        `schema:"block"`    // height or hash for time-lock
	Since    string        `schema:"since"`    // block hash or height for updates
	Unpack   bool          `schema:"unpack"`   // unpack packed key/values
	Prim     bool          `schema:"prim"`     // for prim/value rendering
	Meta     bool          `schema:"meta"`     // include account metadata
	Rights   bool          `schema:"rights"`   // include block rights
	Collapse bool          `schema:"collapse"` // collapse batch lists and internal ops
	Sender   tezos.Address `schema:"sender"`
	Receiver tezos.Address `schema:"receiver"`

	// decoded type condition
	TypeMode pack.FilterMode `schema:"-"`
	TypeList []tezos.OpType  `schema:"-"`

	// decoded values
	BlockHeight int64           `schema:"-"`
	BlockHash   tezos.BlockHash `schema:"-"`
	SinceHeight int64           `schema:"-"`
	SinceHash   tezos.BlockHash `schema:"-"`
}

used when listing ops in block/account/contract context

func (*OpsRequest) Parse

func (r *OpsRequest) Parse(ctx *ApiContext)

implement ParsableRequest interface

func (*OpsRequest) WithCollapse

func (r *OpsRequest) WithCollapse() bool

func (*OpsRequest) WithHeight

func (r *OpsRequest) WithHeight() int64

func (*OpsRequest) WithMeta

func (r *OpsRequest) WithMeta() bool

func (*OpsRequest) WithPrim

func (r *OpsRequest) WithPrim() bool

func (*OpsRequest) WithRights

func (r *OpsRequest) WithRights() bool

func (*OpsRequest) WithUnpack

func (r *OpsRequest) WithUnpack() bool

type Options

type Options interface {
	WithPrim() bool
	WithUnpack() bool
	WithHeight() int64
	WithMeta() bool
	WithRights() bool
	WithCollapse() bool
}

type ParsableRequest

type ParsableRequest interface {
	Parse(ctx *ApiContext)
}

type PerformanceCounter

type PerformanceCounter struct {
	Runtime time.Duration
	// contains filtered or unexported fields
}

func NewPerformanceCounter

func NewPerformanceCounter(now time.Time) *PerformanceCounter

func (*PerformanceCounter) EndCall

func (p *PerformanceCounter) EndCall()

func (*PerformanceCounter) Since

func (p *PerformanceCounter) Since() time.Duration

func (*PerformanceCounter) StartCall

func (p *PerformanceCounter) StartCall(now time.Time)

func (*PerformanceCounter) WriteResponseHeader

func (p *PerformanceCounter) WriteResponseHeader(w http.ResponseWriter)

func (*PerformanceCounter) WriteResponseTrailer

func (p *PerformanceCounter) WriteResponseTrailer(w http.ResponseWriter)

type PingRequest

type PingRequest struct {
	Sequence  int64 `json:"sequence" schema:"sequence"`
	RequestAt int64 `json:"client_time" schema:"client_time"`
}

type Pinger

type Pinger struct {
	Sequence   int64 `json:"sequence"`
	RequestAt  int64 `json:"client_time"` // whatever client sends
	ResponseAt int64 `json:"server_time"` // unix nanosec
}

func (Pinger) Expires

func (p Pinger) Expires() time.Time

func (Pinger) LastModified

func (p Pinger) LastModified() time.Time

func (Pinger) RESTPath

func (p Pinger) RESTPath(r *mux.Router) string

func (Pinger) RESTPrefix

func (p Pinger) RESTPrefix() string

func (Pinger) RegisterDirectRoutes

func (p Pinger) RegisterDirectRoutes(r *mux.Router) error

func (Pinger) RegisterRoutes

func (p Pinger) RegisterRoutes(r *mux.Router) error

type Proposal

type Proposal struct {
	model.Proposal
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*Proposal) MarshalCSV

func (p *Proposal) MarshalCSV() ([]string, error)

func (*Proposal) MarshalJSON

func (p *Proposal) MarshalJSON() ([]byte, error)

func (*Proposal) MarshalJSONBrief

func (p *Proposal) MarshalJSONBrief() ([]byte, error)

func (*Proposal) MarshalJSONVerbose

func (p *Proposal) MarshalJSONVerbose() ([]byte, error)

type RESTful

type RESTful interface {
	RESTPrefix() string
	RESTPath(r *mux.Router) string
	RegisterRoutes(r *mux.Router) error
	RegisterDirectRoutes(r *mux.Router) error
}

type RankList

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

func (RankList) Expires

func (l RankList) Expires() time.Time

func (RankList) LastModified

func (l RankList) LastModified() time.Time

func (RankList) MarshalJSON

func (l RankList) MarshalJSON() ([]byte, error)

type RankListItem

type RankListItem struct {
	Rank    int     `json:"rank"`
	Address string  `json:"address"`
	Balance float64 `json:"balance,omitempty"`
	Traffic int64   `json:"traffic,omitempty"`
	Volume  float64 `json:"volume,omitempty"`
}

type Ranks

type Ranks struct{}

func (Ranks) RESTPath

func (rx Ranks) RESTPath(r *mux.Router) string

func (Ranks) RESTPrefix

func (rx Ranks) RESTPrefix() string

func (Ranks) RegisterDirectRoutes

func (rx Ranks) RegisterDirectRoutes(r *mux.Router) error

func (Ranks) RegisterRoutes

func (rx Ranks) RegisterRoutes(r *mux.Router) error

type Resource

type Resource interface {
	LastModified() time.Time
	Expires() time.Time
}

type RestServer

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

func New

func New(cfg *Config) (*RestServer, error)

func (*RestServer) IsOffline

func (s *RestServer) IsOffline() bool

func (*RestServer) IsShutdown

func (s *RestServer) IsShutdown() bool

func (*RestServer) SetOffline

func (s *RestServer) SetOffline(off bool)

func (*RestServer) Start

func (s *RestServer) Start()

func (*RestServer) Stop

func (s *RestServer) Stop()
type Right struct {
	model.Right
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*Right) MarshalCSV

func (r *Right) MarshalCSV() ([]string, error)

func (*Right) MarshalJSON

func (r *Right) MarshalJSON() ([]byte, error)

func (*Right) MarshalJSONBrief

func (r *Right) MarshalJSONBrief() ([]byte, error)

func (*Right) MarshalJSONVerbose

func (r *Right) MarshalJSONVerbose() ([]byte, error)

func (*Right) Timestamp

func (r *Right) Timestamp() time.Time

func (*Right) TimestampMs

func (r *Right) TimestampMs() int64

type RollbackRequest

type RollbackRequest struct {
	Height int64 `schema:"height" json:"height"` // negative height is treated as offset
	Force  bool  `schema:"force"  json:"force"`  // ignore errors
}

type SeriesBucket

type SeriesBucket interface {
	// database query builder
	BuildQuery(*ApiContext, *SeriesRequest) pack.Query

	// series handlers
	Init(params *tezos.Params, columns []string, verbose bool)
	Add(m SeriesModel)
	IsEmpty() bool
	Reset()
	Clone() SeriesBucket
	Null(time.Time) SeriesBucket
	Zero(time.Time) SeriesBucket
	Time() time.Time
	SetTime(time.Time) SeriesBucket
	Interpolate(SeriesBucket, time.Time) SeriesBucket

	// series marshallers
	json.Marshaler
	csv.Marshaler
	MarshalJSONVerbose() ([]byte, error)
	MarshalJSONBrief() ([]byte, error)
}

New common series handling below

type SeriesModel

type SeriesModel interface {
	Time() time.Time
}

type SeriesRequest

type SeriesRequest struct {
	Series   string          `schema:"-"`
	Columns  util.StringList `schema:"columns"`
	Collapse util.Duration   `schema:"collapse"`
	FillMode FillMode        `schema:"fill"`
	From     util.Time       `schema:"start_date"`
	To       util.Time       `schema:"end_date"`
	Limit    uint            `schema:"limit"`
	Verbose  bool            `schema:"verbose"`
	Format   string          `schema:"-"`     // from URL
	Order    pack.OrderType  `schema:"order"` // asc/desc
	// contains filtered or unexported fields
}

build packdb query from request

func (SeriesRequest) Expires

func (t SeriesRequest) Expires() time.Time

func (*SeriesRequest) Fill

func (args *SeriesRequest) Fill(from, to time.Time, fillFunc func(SeriesBucket) error) error

func (SeriesRequest) LastModified

func (t SeriesRequest) LastModified() time.Time

func (*SeriesRequest) Parse

func (r *SeriesRequest) Parse(ctx *ApiContext)

func (SeriesRequest) RESTPath

func (t SeriesRequest) RESTPath(r *mux.Router) string

func (SeriesRequest) RESTPrefix

func (t SeriesRequest) RESTPrefix() string

func (SeriesRequest) RegisterDirectRoutes

func (t SeriesRequest) RegisterDirectRoutes(r *mux.Router) error

func (SeriesRequest) RegisterRoutes

func (t SeriesRequest) RegisterRoutes(r *mux.Router) error

func (*SeriesRequest) StreamCSV

func (args *SeriesRequest) StreamCSV(ctx *ApiContext) error

func (*SeriesRequest) StreamJSON

func (args *SeriesRequest) StreamJSON(ctx *ApiContext) error

func (*SeriesRequest) StreamResponse

func (args *SeriesRequest) StreamResponse(ctx *ApiContext) (interface{}, int)

type Snapshot

type Snapshot struct {
	model.Snapshot
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*Snapshot) MarshalCSV

func (s *Snapshot) MarshalCSV() ([]string, error)

func (*Snapshot) MarshalJSON

func (s *Snapshot) MarshalJSON() ([]byte, error)

func (*Snapshot) MarshalJSONBrief

func (s *Snapshot) MarshalJSONBrief() ([]byte, error)

func (*Snapshot) MarshalJSONVerbose

func (s *Snapshot) MarshalJSONVerbose() ([]byte, error)

type Supply

type Supply struct {
	model.Supply
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*Supply) MarshalCSV

func (s *Supply) MarshalCSV() ([]string, error)

func (*Supply) MarshalJSON

func (s *Supply) MarshalJSON() ([]byte, error)

func (*Supply) MarshalJSONBrief

func (s *Supply) MarshalJSONBrief() ([]byte, error)

func (*Supply) MarshalJSONVerbose

func (s *Supply) MarshalJSONVerbose() ([]byte, error)

type SupplySeries

type SupplySeries struct {
	model.Supply
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*SupplySeries) Add

func (s *SupplySeries) Add(m SeriesModel)

func (*SupplySeries) BuildQuery

func (s *SupplySeries) BuildQuery(ctx *ApiContext, args *SeriesRequest) pack.Query

func (*SupplySeries) Clone

func (s *SupplySeries) Clone() SeriesBucket

func (*SupplySeries) Init

func (s *SupplySeries) Init(params *tezos.Params, columns []string, verbose bool)

func (*SupplySeries) Interpolate

func (s *SupplySeries) Interpolate(m SeriesBucket, ts time.Time) SeriesBucket

func (*SupplySeries) IsEmpty

func (s *SupplySeries) IsEmpty() bool

func (*SupplySeries) MarshalCSV

func (s *SupplySeries) MarshalCSV() ([]string, error)

func (*SupplySeries) MarshalJSON

func (s *SupplySeries) MarshalJSON() ([]byte, error)

func (*SupplySeries) MarshalJSONBrief

func (s *SupplySeries) MarshalJSONBrief() ([]byte, error)

func (*SupplySeries) MarshalJSONVerbose

func (s *SupplySeries) MarshalJSONVerbose() ([]byte, error)

func (*SupplySeries) Null

func (s *SupplySeries) Null(ts time.Time) SeriesBucket

func (*SupplySeries) Reset

func (s *SupplySeries) Reset()

func (*SupplySeries) SetTime

func (s *SupplySeries) SetTime(ts time.Time) SeriesBucket

func (*SupplySeries) Time

func (s *SupplySeries) Time() time.Time

func (*SupplySeries) Zero

func (s *SupplySeries) Zero(ts time.Time) SeriesBucket

type SystemRequest

type SystemRequest struct{}

func (SystemRequest) Expires

func (t SystemRequest) Expires() time.Time

func (SystemRequest) LastModified

func (t SystemRequest) LastModified() time.Time

func (SystemRequest) RESTPath

func (t SystemRequest) RESTPath(r *mux.Router) string

func (SystemRequest) RESTPrefix

func (t SystemRequest) RESTPrefix() string

func (SystemRequest) RegisterDirectRoutes

func (t SystemRequest) RegisterDirectRoutes(r *mux.Router) error

func (SystemRequest) RegisterRoutes

func (t SystemRequest) RegisterRoutes(r *mux.Router) error

type TableRequest

type TableRequest struct {
	Table   string          `schema:"-"`
	Columns util.StringList `schema:"columns"`
	Limit   uint            `schema:"limit"`
	Cursor  string          `schema:"cursor"`
	Format  string          `schema:"-"`     // from URL
	Order   pack.OrderType  `schema:"order"` // asc/desc
	Verbose bool            `schema:"verbose"`
}

build packdb query from request

func (TableRequest) Expires

func (t TableRequest) Expires() time.Time

func (TableRequest) LastModified

func (t TableRequest) LastModified() time.Time

func (*TableRequest) Parse

func (t *TableRequest) Parse(ctx *ApiContext)

func (TableRequest) RESTPath

func (t TableRequest) RESTPath(r *mux.Router) string

func (TableRequest) RESTPrefix

func (t TableRequest) RESTPrefix() string

func (TableRequest) RegisterDirectRoutes

func (t TableRequest) RegisterDirectRoutes(r *mux.Router) error

func (TableRequest) RegisterRoutes

func (t TableRequest) RegisterRoutes(r *mux.Router) error

type Vote

type Vote struct {
	model.Vote
	// contains filtered or unexported fields
}

configurable marshalling helper

func (*Vote) MarshalCSV

func (v *Vote) MarshalCSV() ([]string, error)

func (*Vote) MarshalJSON

func (v *Vote) MarshalJSON() ([]byte, error)

func (*Vote) MarshalJSONBrief

func (v *Vote) MarshalJSONBrief() ([]byte, error)

func (*Vote) MarshalJSONVerbose

func (v *Vote) MarshalJSONVerbose() ([]byte, error)

type Worker

type Worker struct {
	WorkerPool chan chan *ApiContext
	JobChannel chan *ApiContext
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(workerPool chan chan *ApiContext) Worker

func (Worker) Start

func (w Worker) Start()

func (Worker) Stop

func (w Worker) Stop()

Stop signals the worker to stop listening for work requests.

Jump to

Keyboard shortcuts

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