models

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainConnectionStatus

type ChainConnectionStatus struct {
	IsL1Healthy bool
	IsL2Healthy bool
}

ChainConnectionStatus ... Used to display health status of each node connection

type HealthCheck

type HealthCheck struct {
	Timestamp             time.Time
	Healthy               bool
	ChainConnectionStatus *ChainConnectionStatus
}

HealthCheck ... Returns health status of server

type HeuristicMethod added in v1.0.0

type HeuristicMethod int

HeuristicMethod ... Represents the heuristic operation method

const (
	Run HeuristicMethod = iota
	// NOTE - Update is not implemented yet
	Update
	// NOTE - Stop is not implemented yet
	Stop
)

func StringToHeuristicMethod added in v1.0.0

func StringToHeuristicMethod(s string) HeuristicMethod

type Result added in v1.0.0

type Result = map[string]string

Result ... Result of heuristic operation

type SessionRequestBody added in v1.0.0

type SessionRequestBody struct {
	Method string               `json:"method"`
	Params SessionRequestParams `json:"params"`
}

SessionRequestBody ... Request body for heuristic operation request

func (*SessionRequestBody) Clone added in v1.0.0

func (irb *SessionRequestBody) Clone() *SessionRequestBody

func (*SessionRequestBody) MethodType added in v1.0.0

func (irb *SessionRequestBody) MethodType() HeuristicMethod

MethodType ... Returns the heuristic method type

type SessionRequestParams added in v1.0.0

type SessionRequestParams struct {
	Network       string `json:"network"`
	PType         string `json:"pipeline_type"`
	HeuristicType string `json:"type"`

	StartHeight *big.Int `json:"start_height"`
	EndHeight   *big.Int `json:"end_height"`

	SessionParams  map[string]interface{} `json:"heuristic_params"`
	AlertingParams *core.AlertPolicy      `json:"alerting_params"`
}

SessionRequestParams ... Request params for heuristic operation

func (*SessionRequestParams) AlertPolicy added in v1.0.0

func (hrp *SessionRequestParams) AlertPolicy() *core.AlertPolicy

func (*SessionRequestParams) AlertingDestType added in v1.0.0

func (hrp *SessionRequestParams) AlertingDestType() core.AlertDestination

AlertingDestType ... Returns the alerting destination type

func (*SessionRequestParams) GeneratePipelineConfig added in v1.0.0

func (hrp *SessionRequestParams) GeneratePipelineConfig(pollInterval time.Duration,
	regType core.RegisterType) *core.PipelineConfig

GeneratePipelineConfig ... Generates a pipeline config using the request params

func (*SessionRequestParams) Heuristic added in v1.0.0

func (hrp *SessionRequestParams) Heuristic() core.HeuristicType

Heuristic ... Returns the heuristic type

func (*SessionRequestParams) NetworkType added in v1.0.0

func (hrp *SessionRequestParams) NetworkType() core.Network

NetworkType ... Returns the network type

func (*SessionRequestParams) Params added in v1.0.0

func (hrp *SessionRequestParams) Params() *core.SessionParams

Params ... Returns the heuristic session params

func (*SessionRequestParams) PipelineType added in v1.0.0

func (hrp *SessionRequestParams) PipelineType() core.PipelineType

PipelineType ... Returns the pipeline type

func (*SessionRequestParams) SessionConfig added in v1.0.0

func (hrp *SessionRequestParams) SessionConfig() *core.SessionConfig

SessionConfig ... Generates a session config using the request params

type SessionResponse added in v1.0.0

type SessionResponse struct {
	Code   int                   `json:"status_code"`
	Status SessionResponseStatus `json:"status"`

	Result Result `json:"result"`
	Error  string `json:"error"`
}

SessionResponse ... Response for heuristic operation request

func NewSessionAcceptedResp added in v1.0.0

func NewSessionAcceptedResp(id core.SUUID) *SessionResponse

NewSessionAcceptedResp ...Returns a heuristic response with status accepted

func NewSessionNoProcessResp added in v1.0.0

func NewSessionNoProcessResp() *SessionResponse

NewSessionNoProcessResp ... New internal processing response error

func NewSessionUnmarshalErrResp added in v1.0.0

func NewSessionUnmarshalErrResp() *SessionResponse

NewSessionUnmarshalErrResp ... New unmarshal error response construction

type SessionResponseStatus added in v1.0.0

type SessionResponseStatus string

SessionResponseStatus ... Represents the heuristic operation response status

const (
	OK    SessionResponseStatus = "OK"
	NotOK SessionResponseStatus = "NOTOK"
)

Jump to

Keyboard shortcuts

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