Documentation ¶
Index ¶
- Constants
- func IsInternalMethod(method string) bool
- type AdminContractService
- type ContractService
- type DummyArgs
- type DummyReply
- type FuncTestContractService
- func (s *FuncTestContractService) CallConstructor(r *http.Request, args *DummyArgs, requestBody *rpc.RequestBody, ...) error
- func (s *FuncTestContractService) CallMethod(r *http.Request, args *DummyArgs, requestBody *rpc.RequestBody, ...) error
- func (s *FuncTestContractService) Upload(r *http.Request, args *DummyArgs, requestBody *rpc.RequestBody, ...) error
- type HealthChecker
- type InfoArgs
- type InfoReply
- type InfoService
- type NetworkChecker
- type NodeCertArgs
- type NodeCertReply
- type NodeCertService
- type NodeService
- type RequestValidator
- type Runner
- type RunnerWrapper
- type SeedArgs
- type UploadReply
Constants ¶
const ( ParseError = -31700 ParseErrorShort = "ParseError" ParseErrorMessage = "Parsing error on the server side: received an invalid JSON." InvalidRequestError = -31600 InvalidRequestErrorShort = "InvalidRequest" InvalidRequestErrorMessage = "The JSON received is not a valid request payload." MethodNotFoundError = -31601 MethodNotFoundErrorShort = "MethodNotFound" MethodNotFoundErrorMessage = "Method does not exist / is not available." InvalidParamsError = -31602 InvalidParamsErrorShort = "InvalidParams" InvalidParamsErrorMessage = "Invalid method parameter(s)." InternalError = -31603 InternalErrorShort = "Internal" InternalErrorMessage = "Internal Platform error." TimeoutError = -31106 TimeoutErrorShort = "Timeout" TimeoutErrorMessage = "Request's timeout has expired." ExecutionError = -31103 ExecutionErrorShort = "Execution" ExecutionErrorMessage = "Execution error." )
Variables ¶
This section is empty.
Functions ¶
func IsInternalMethod ¶ added in v1.1.0
Types ¶
type AdminContractService ¶
type AdminContractService struct {
// contains filtered or unexported fields
}
AdminContractService is a service that provides API for working with smart contracts.
func NewAdminContractService ¶
func NewAdminContractService(runner *Runner) *AdminContractService
NewAdminContractService creates new AdminContract service instance.
func (*AdminContractService) Call ¶
func (cs *AdminContractService) Call(req *http.Request, args *requester.Params, requestBody *rpc.RequestBody, result *requester.ContractResult) error
type ContractService ¶
type ContractService struct {
// contains filtered or unexported fields
}
ContractService is a service that provides API for working with smart contracts.
func NewContractService ¶
func NewContractService(runner *Runner) *ContractService
NewContractService creates new Contract service instance.
func (*ContractService) Call ¶
func (cs *ContractService) Call(req *http.Request, args *requester.Params, requestBody *rpc.RequestBody, result *requester.ContractResult) error
type DummyReply ¶
type DummyReply struct{}
type FuncTestContractService ¶
type FuncTestContractService struct {
// contains filtered or unexported fields
}
FuncTestContractService is a service that provides ability to add custom contracts
func NewFuncTestContractService ¶
func NewFuncTestContractService(runner *Runner) *FuncTestContractService
NewFuncTestContractService is dummy for NewFuncTestContractService in functest_contract.go that hidden under build tag
func (*FuncTestContractService) CallConstructor ¶
func (s *FuncTestContractService) CallConstructor(r *http.Request, args *DummyArgs, requestBody *rpc.RequestBody, reply *DummyReply) error
func (*FuncTestContractService) CallMethod ¶
func (s *FuncTestContractService) CallMethod(r *http.Request, args *DummyArgs, requestBody *rpc.RequestBody, reply *DummyReply) error
func (*FuncTestContractService) Upload ¶
func (s *FuncTestContractService) Upload(r *http.Request, args *DummyArgs, requestBody *rpc.RequestBody, reply *DummyReply) error
type HealthChecker ¶
type HealthChecker struct { CertificateManager insolar.CertificateManager NodeNetwork network.NodeNetwork // nolint: staticcheck PulseAccessor pulse.Accessor }
HealthChecker allows to check network status of a node.
func NewHealthChecker ¶
func NewHealthChecker(cm insolar.CertificateManager, nn network.NodeNetwork, pa pulse.Accessor) *HealthChecker
NewHealthChecker creates new HealthChecker.
func (*HealthChecker) CheckHandler ¶
func (hc *HealthChecker) CheckHandler(w http.ResponseWriter, r *http.Request)
CheckHandler is a HTTP handler for health check.
type InfoReply ¶
type InfoReply struct { RootDomain string `json:"rootDomain"` RootMember string `json:"rootMember"` MigrationAdminMember string `json:"migrationAdminMember"` FeeMember string `json:"feeMember"` MigrationDaemonMembers []string `json:"migrationDaemonMembers"` NodeDomain string `json:"nodeDomain"` TraceID string `json:"traceID"` }
InfoReply is reply for Info service requests.
type InfoService ¶
type InfoService struct {
// contains filtered or unexported fields
}
InfoService is a service that provides API for getting info about genesis objects.
func NewInfoService ¶
func NewInfoService(runner *Runner) *InfoService
NewInfoService creates new Info service instance.
type NetworkChecker ¶
type NetworkChecker struct {
// contains filtered or unexported fields
}
NetworkChecker is AvailabilityChecker implementation that checks can we process any API requests based on keeper status
func NewNetworkChecker ¶
func NewNetworkChecker(cfg configuration.AvailabilityChecker) *NetworkChecker
func (*NetworkChecker) IsAvailable ¶
func (nc *NetworkChecker) IsAvailable(ctx context.Context) bool
func (*NetworkChecker) Stop ¶
func (nc *NetworkChecker) Stop()
type NodeCertArgs ¶
type NodeCertArgs struct {
Ref string
}
NodeCertArgs is arguments that NodeCert service accepts.
type NodeCertReply ¶
type NodeCertReply struct {
Cert *certificate.Certificate `json:"cert"`
}
NodeCertReply is reply for NodeCert service requests.
type NodeCertService ¶
type NodeCertService struct {
// contains filtered or unexported fields
}
NodeCertService is a service that provides cert for node.
func NewNodeCertService ¶
func NewNodeCertService(runner *Runner) *NodeCertService
NewNodeCertService creates new NodeCert service instance.
func (*NodeCertService) Get ¶
func (s *NodeCertService) Get(r *http.Request, args *NodeCertArgs, requestBody *rpc.RequestBody, reply *NodeCertReply) error
type NodeService ¶
type NodeService struct {
// contains filtered or unexported fields
}
NodeService is a service that provides API for getting new seed and status.
func NewNodeService ¶
func NewNodeService(runner *Runner) *NodeService
NewNodeService creates new Node service instance.
func (*NodeService) GetStatus ¶
func (s *NodeService) GetStatus(r *http.Request, args *interface{}, requestBody *rpc.RequestBody, reply *requester.StatusResponse) error
Get returns status info
type RequestValidator ¶ added in v1.1.0
type RequestValidator struct {
// contains filtered or unexported fields
}
func NewRequestValidator ¶ added in v1.1.0
func NewRequestValidator(path string, next http.Handler) (*RequestValidator, error)
func (*RequestValidator) ServeHTTP ¶ added in v1.1.0
func (rv *RequestValidator) ServeHTTP(w http.ResponseWriter, httpReq *http.Request)
type Runner ¶
type Runner struct { CertificateManager insolar.CertificateManager ContractRequester insolar.ContractRequester // nolint NodeNetwork network.NodeNetwork CertificateGetter insolar.CertificateGetter PulseAccessor pulse.Accessor ArtifactManager artifacts.Client JetCoordinator jet.Coordinator NetworkStatus insolar.NetworkStatus AvailabilityChecker insolar.AvailabilityChecker SeedManager *seedmanager.SeedManager SeedGenerator seedmanager.SeedGenerator // contains filtered or unexported fields }
Runner implements Component for API
func NewRunner ¶
func NewRunner(cfg *configuration.APIRunner, certificateManager insolar.CertificateManager, contractRequester insolar.ContractRequester, nodeNetwork network.NodeNetwork, certificateGetter insolar.CertificateGetter, pulseAccessor pulse.Accessor, artifactManager artifacts.Client, jetCoordinator jet.Coordinator, networkStatus insolar.NetworkStatus, availabilityChecker insolar.AvailabilityChecker, ) (*Runner, error)
NewRunner is C-tor for API Runner
func (*Runner) IsAPIRunner ¶
IsAPIRunner is implementation of APIRunner interface for component manager
type RunnerWrapper ¶
func NewWrapper ¶
func NewWrapper(publicAPI, adminAPI insolar.APIRunner) *RunnerWrapper
NewWrapper is C-tor for wrapper of API Runner
type UploadReply ¶
type UploadReply struct {
PrototypeRef string `json:"PrototypeRef"`
}