types

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: CC0-1.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionHandler

type ActionHandler = func(context *Context, payload *Payload) (interface{}, error)

ActionHandler represents a Hasura action request handler. It returns an interface to be returned to the called, or an error if something is wrong

type ActionsWorker

type ActionsWorker struct {
	// contains filtered or unexported fields
}

ActionsWorker represents the worker that is used to handle Hasura actions queries

func NewActionsWorker

func NewActionsWorker(context *Context) *ActionsWorker

NewActionsWorker returns a new ActionsWorker instance

func (*ActionsWorker) RegisterHandler

func (w *ActionsWorker) RegisterHandler(path string, handler ActionHandler)

RegisterHandler registers the provided handler to be used on each call to the provided path

func (*ActionsWorker) Start

func (w *ActionsWorker) Start(port uint)

Start starts the worker

type Balance

type Balance struct {
	Coins []Coin `json:"coins"`
}

type Coin

type Coin struct {
	Amount string `json:"amount"`
	Denom  string `json:"denom"`
}

func ConvertCoins

func ConvertCoins(coins sdk.Coins) []Coin

type Context

type Context struct {
	Node node.Node
}

Context contains the data about a Hasura actions worker execution

func NewContext

func NewContext(node node.Node) *Context

NewContext returns a new Context instance

type GraphQLError

type GraphQLError struct {
	Message string `json:"message"`
}

type Payload

type Payload struct {
	SessionVariables map[string]interface{} `json:"session_variables"`
	Input            PayloadArgs            `json:"input"`
}

Payload contains the payload data that is sent from Hasura

func (*Payload) GetAddress

func (p *Payload) GetAddress() string

GetAddress returns the address associated with this payload, if any

type PayloadArgs

type PayloadArgs struct {
	Address    string `json:"address"`
	Height     int64  `json:"height"`
	Offset     uint64 `json:"offset"`
	Limit      uint64 `json:"limit"`
	CountTotal bool   `json:"count_total"`
}

Jump to

Keyboard shortcuts

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