Documentation
¶
Index ¶
- Variables
- type Address
- type Chore
- func (c *Chore) Close() error
- func (c *Chore) PersistRequests(ctx context.Context) (err error)
- func (c *Chore) Pin(ctx context.Context, txHash string, ix uint, cid string, amount *big.Int) error
- func (c *Chore) PinMissing(ctx context.Context) (err error)
- func (c *Chore) RecordError(ctx context.Context, transaction string, index uint, cid string, s string) error
- func (c *Chore) Run(ctx context.Context) error
- type Config
- type Endpoint
- func (endpoint *Endpoint) Block(w http.ResponseWriter, r *http.Request)
- func (endpoint *Endpoint) Blocks(w http.ResponseWriter, r *http.Request)
- func (endpoint *Endpoint) Config(w http.ResponseWriter, r *http.Request)
- func (endpoint *Endpoint) PinOfHash(w http.ResponseWriter, request *http.Request)
- func (endpoint *Endpoint) Pins(w http.ResponseWriter, r *http.Request)
- func (endpoint *Endpoint) Register(router *mux.Router)
- type Hash
- type Service
- func (service *Service) AllPins(ctx context.Context) (result []pindb.Pin, err error)
- func (service *Service) Cid(ctx context.Context, hash string) (result pindb.Cid, err error)
- func (service *Service) Cids(ctx context.Context) (result []pindb.Cid, err error)
- func (service *Service) Config(ctx context.Context) (cfg WebConfig, err error)
- func (service *Service) PinsFromChain(ctx context.Context) (_ []pindb.Pin, err error)
- func (service *Service) PinsOfHash(ctx context.Context, cid string) (result []pindb.Pin, err error)
- type WebConfig
Constants ¶
This section is empty.
Variables ¶
var ErrEndpoint = errs.Class("pin endpoint")
ErrEndpoint - pin endpoint error class.
var ErrService = errs.Class("pin service")
ErrService - pin service error class.
Functions ¶
This section is empty.
Types ¶
type Address ¶
Address represents address in ethereum network.
func AddressFromHex ¶
AddressFromHex creates new address from hex string.
type Chore ¶
type Chore struct { Loop *sync2.Cycle IPFS *ipfs.Service ByteDayPrice *big.Int // contains filtered or unexported fields }
Chore persists new on-chain events to the db
func (*Chore) PersistRequests ¶
PersistRequests reads all the pin requests and save them to the db.
func (*Chore) PinMissing ¶
PinMissing pins the requests which are not yet pinned.
func (*Chore) RecordError ¶
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
Endpoint for querying ERC20 token information from ethereum chain.
architecture: Endpoint
func NewEndpoint ¶
NewEndpoint creates new payments endpoint instance.
func (*Endpoint) Block ¶
func (endpoint *Endpoint) Block(w http.ResponseWriter, r *http.Request)
Block endpoint retrieves one Block which is pinned.
func (*Endpoint) Blocks ¶
func (endpoint *Endpoint) Blocks(w http.ResponseWriter, r *http.Request)
Blocks endpoint retrieves all Blocks which are pinned.
func (*Endpoint) Config ¶
func (endpoint *Endpoint) Config(w http.ResponseWriter, r *http.Request)
Config returns with the actual config required by the web UI.
func (*Endpoint) PinOfHash ¶
func (endpoint *Endpoint) PinOfHash(w http.ResponseWriter, request *http.Request)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service for querying ERC20 token information from ethereum chain.
architecture: Service
func NewService ¶
func NewService(log *zap.Logger, db *pindb.PinDB, endpoint string, token Address, pin Address) *Service
NewService creates new token service instance.
func (*Service) PinsFromChain ¶
PinsFromChain returns with all on-chain pin request