graphql

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Overview

Package graphql for grid graphql support

Package graphql for grid graphql support

Index

Constants

This section is empty.

Variables

View Source
var ErrorContractsNotFound = fmt.Errorf("could not find any contracts")

Functions

This section is empty.

Types

type Contract

type Contract struct {
	ContractID     string `json:"contractID"`
	State          string `json:"state"`
	DeploymentData string `json:"deploymentData"`

	// for node and rent contracts
	NodeID uint32 `json:"nodeID"`
	// for name contracts
	Name string `json:"name"`
}

Contract from graphql

type Contracts

type Contracts struct {
	NameContracts []Contract `json:"nameContracts"`
	NodeContracts []Contract `json:"nodeContracts"`
	RentContracts []Contract `json:"rentContracts"`
}

Contracts from graphql

type ContractsGetter

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

ContractsGetter for contracts getter from graphql

func NewContractsGetter

func NewContractsGetter(twinID uint32, graphql GraphQl, substrateConn subi.SubstrateExt, ncPool client.NodeClientGetter) ContractsGetter

NewContractsGetter return a new Getter for contracts

func (*ContractsGetter) GetNodeContractsByTypeAndName

func (c *ContractsGetter) GetNodeContractsByTypeAndName(projectName, deploymentType, deploymentName string) (map[uint32]uint64, error)

GetNodeContractsByTypeAndName list node contracts for a given type, project name and deployment name

func (*ContractsGetter) ListContractsByTwinID

func (c *ContractsGetter) ListContractsByTwinID(states []string) (Contracts, error)

ListContractsByTwinID returns contracts for a twinID

func (*ContractsGetter) ListContractsOfProjectName

func (c *ContractsGetter) ListContractsOfProjectName(projectName string, noGateways ...bool) (Contracts, error)

ListContractsOfProjectName returns contracts for a project name

type GraphQl

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

GraphQl for tf graphql

func NewGraphQl

func NewGraphQl(url string) (GraphQl, error)

NewGraphQl new tf graphql

func (*GraphQl) GetItemTotalCount

func (g *GraphQl) GetItemTotalCount(itemName string, options string) (float64, error)

GetItemTotalCount return count of items

func (*GraphQl) Query

func (g *GraphQl) Query(body string, variables map[string]interface{}) (map[string]interface{}, error)

Query queries graphql

Jump to

Keyboard shortcuts

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