models

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 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 InvRequestBody

type InvRequestBody struct {
	Method string           `json:"method"`
	Params InvRequestParams `json:"params"`
}

InvRequestBody ... Request body for invariant operation request

func (*InvRequestBody) Clone

func (irb *InvRequestBody) Clone() *InvRequestBody

func (*InvRequestBody) MethodType

func (irb *InvRequestBody) MethodType() InvariantMethod

MethodType ... Returns the invariant method type

type InvRequestParams

type InvRequestParams struct {
	Network string `json:"network"`
	PType   string `json:"pipeline_type"`
	InvType string `json:"type"`

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

	SessionParams map[string]interface{} `json:"invariant_params"`
	// TODO(#81): No Support for Multiple Alerting Destinations for an Invariant Session
	AlertingDest string `json:"alert_destination"`
}

InvRequestParams ... Request params for invariant operation

func (*InvRequestParams) AlertingDestType

func (irp *InvRequestParams) AlertingDestType() core.AlertDestination

AlertingDestType ... Returns the alerting destination type

func (*InvRequestParams) GeneratePipelineConfig

func (irp *InvRequestParams) GeneratePipelineConfig(pollInterval time.Duration,
	regType core.RegisterType) *core.PipelineConfig

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

func (*InvRequestParams) InvariantType

func (irp *InvRequestParams) InvariantType() core.InvariantType

InvariantType ... Returns the invariant type

func (*InvRequestParams) NetworkType

func (irp *InvRequestParams) NetworkType() core.Network

NetworkType ... Returns the network type

func (*InvRequestParams) Params

func (irp *InvRequestParams) Params() *core.InvSessionParams

Params ... Returns the invariant session params

func (*InvRequestParams) PipelineType

func (irp *InvRequestParams) PipelineType() core.PipelineType

PipelineType ... Returns the pipeline type

func (*InvRequestParams) SessionConfig

func (irp *InvRequestParams) SessionConfig() *core.SessionConfig

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

type InvResponse

type InvResponse struct {
	Code   int               `json:"status_code"`
	Status InvResponseStatus `json:"status"`

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

InvResponse ... Response for invariant operation request

func NewInvAcceptedResp

func NewInvAcceptedResp(id core.SUUID) *InvResponse

NewInvAcceptedResp ...Returns an invariant response with status accepted

func NewInvNoProcessInvResp

func NewInvNoProcessInvResp() *InvResponse

NewInvNoProcessInvResp ... New internal processing response error

func NewInvUnmarshalErrResp

func NewInvUnmarshalErrResp() *InvResponse

NewInvUnmarshalErrResp ... New unmarshal error response construction

type InvResponseStatus

type InvResponseStatus string

InvResponseStatus ... Represents the invariant operation response status

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

type InvResult

type InvResult = map[string]string

InvResult ... Result of invariant operation

type InvariantMethod

type InvariantMethod int

InvariantMethod ... Represents the invariant operation method

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

func StringToInvariantMethod

func StringToInvariantMethod(s string) InvariantMethod

Jump to

Keyboard shortcuts

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