Documentation
¶
Overview ¶
Package api provides the functionality of the Mop client-facing HTTP API.
Index ¶
- Constants
- Variables
- type ExtraOptions
- type FileInfo
- type MopNodeMode
- type Options
- type Peer
- type Probe
- type ProbeStatus
- type Service
- func (s *Service) Close() error
- func (s *Service) Configure(signer crypto.Signer, auth authenticator, tracer *tracer.Tracer, o Options, ...) <-chan *pusher.Op
- func (s *Service) Metrics() []prometheus.Collector
- func (s *Service) MountAPI()
- func (s *Service) MountDebug(restricted bool)
- func (s *Service) MountTechnicalDebug()
- func (s *Service) MustRegisterMetrics(cs ...prometheus.Collector)
- func (s *Service) SetClusterAddress(addr *cluster.Address)
- func (s *Service) SetP2P(p2p p2p.DebugService)
- func (s *Service) SetProbe(probe *Probe)
- type UpgradedResponseWriter
Constants ¶
const ( ClusterPinHeader = "Cluster-Pin" ClusterTagHeader = "Cluster-Tag" ClusterEncryptHeader = "Cluster-Encrypt" ClusterIndexDocumentHeader = "Cluster-Index-Document" ClusterErrorDocumentHeader = "Cluster-Error-Document" ClusterFeedIndexHeader = "Cluster-Feed-Index" ClusterFeedIndexNextHeader = "Cluster-Feed-Index-Next" ClusterCollectionHeader = "Cluster-Collection" ClusterVoucherBatchIdHeader = "Cluster-Voucher-Batch-Id" ClusterDeferredUploadHeader = "Cluster-Deferred-Upload" )
Variables ¶
var Version = "0.0.0"
Version is set in the build process.
Functions ¶
This section is empty.
Types ¶
type ExtraOptions ¶
type ExtraOptions struct { Pingpong pingpong.Interface TopologyDriver topology.Driver LightNodes *lightnode.Container Accounting bookkeeper.Interface Pseudosettle settlement.Interface Swap swap.Interface Chequebook chequebook.Service BlockTime *big.Int Tags *tags.Tags Storer storage.Storer Resolver resolver.Interface Pss psser.Interface TraversalService traverser.Traverser Pinning pins.Interface FeedFactory feeds.Factory Post voucher.Service VoucherContract vouchercontract.Interface PledgeContract pledge.Service RewardContract reward.Service Warden warden.Interface SyncStatus func() (bool, error) StoreDirectory func() string }
type MopNodeMode ¶
type MopNodeMode uint
const ( LightMode MopNodeMode = iota FullMode DevMode UltraLightMode )
func (MopNodeMode) String ¶
func (b MopNodeMode) String() string
type Probe ¶ added in v0.9.1
type Probe struct {
// contains filtered or unexported fields
}
Probe structure holds flags which indicate node healthiness (sometimes refert also as liveness) and readiness.
func (*Probe) Healthy ¶ added in v0.9.1
func (p *Probe) Healthy() ProbeStatus
Healthy returns the value of the healthy status.
func (*Probe) Ready ¶ added in v0.9.1
func (p *Probe) Ready() ProbeStatus
Ready returns the value of the ready status.
func (*Probe) SetHealthy ¶ added in v0.9.1
func (p *Probe) SetHealthy(ps ProbeStatus)
SetHealthy updates the value of the healthy status.
func (*Probe) SetReady ¶ added in v0.9.1
func (p *Probe) SetReady(ps ProbeStatus)
SetReady updates the value of the ready status.
type ProbeStatus ¶ added in v0.9.1
type ProbeStatus int32
ProbeStatus is the status of a probe. ProbeStatus is treated as a sync/atomic int32.
const ( // ProbeStatusOK indicates positive ProbeStatus status. ProbeStatusOK ProbeStatus = 1 // ProbeStatusNOK indicates negative ProbeStatus status. ProbeStatusNOK ProbeStatus = 0 )
func (ProbeStatus) String ¶ added in v0.9.1
func (ps ProbeStatus) String() string
String implements the fmt.Stringer interface.
type Service ¶
func (*Service) Configure ¶
func (s *Service) Configure(signer crypto.Signer, auth authenticator, tracer *tracer.Tracer, o Options, e ExtraOptions, chainID int64, erc20 erc20.Service) <-chan *pusher.Op
Configure will create a and initialize a new API service.
func (*Service) Metrics ¶
func (s *Service) Metrics() []prometheus.Collector
func (*Service) MountDebug ¶
func (*Service) MountTechnicalDebug ¶
func (s *Service) MountTechnicalDebug()
func (*Service) MustRegisterMetrics ¶
func (s *Service) MustRegisterMetrics(cs ...prometheus.Collector)
func (*Service) SetClusterAddress ¶
func (*Service) SetP2P ¶
func (s *Service) SetP2P(p2p p2p.DebugService)
type UpgradedResponseWriter ¶
type UpgradedResponseWriter interface { http.ResponseWriter http.Pusher http.Hijacker http.Flusher // staticcheck SA1019 CloseNotifier interface is required by gorilla compress handler // nolint:staticcheck http.CloseNotifier }
UpgradedResponseWriter adds more functionality on top of ResponseWriter
Source Files
¶
- accounting.go
- api.go
- balances.go
- bytes.go
- chequebook.go
- chunk.go
- chunk_address.go
- chunk_stream.go
- dirs.go
- feed.go
- health.go
- job.go
- logger.go
- metrics.go
- mop.go
- node.go
- p2p.go
- peer.go
- pin.go
- pingpong.go
- probe.go
- pss.go
- readiness.go
- router.go
- settlements.go
- soc.go
- subdomain.go
- tag.go
- tag_debug.go
- topology.go
- transaction.go
- version.go
- voucher.go
- wallet.go
- wardenship.go
- welcome_message.go
Directories
¶
Path | Synopsis |
---|---|
Package jsonhttp contains utility functions that make it easier to create JSON-based HTTP APIs.
|
Package jsonhttp contains utility functions that make it easier to create JSON-based HTTP APIs. |
jsonhttptest
Package jsonhttptest helps with end-to-end testing of JSON-based HTTP APIs.
|
Package jsonhttptest helps with end-to-end testing of JSON-based HTTP APIs. |