query

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPath = errors.New("query: invalid path")
)

Functions

func DeploymentPath

func DeploymentPath(id types.DeploymentID) string

DeploymentPath return deployment path of given deployment id for queries

func ParseGroupPath

func ParseGroupPath(parts []string) (types.GroupID, error)

ParseGroupPath returns GroupID details with provided queries, and return error if occurred due to wrong query

Types

type Client

type Client interface {
	Deployments(DeploymentFilters) (Deployments, error)
	Deployment(types.DeploymentID) (Deployment, error)
	Group(types.GroupID) (Group, error)
}

Client interface

func NewClient

func NewClient(ctx sdkclient.Context, key string) Client

NewClient creates a client instance with provided context and key

type Deployment

type Deployment struct {
	types.Deployment `json:"deployment"`
	Groups           []types.Group `json:"groups"`
}

Deployment stores deployment and groups details

func (Deployment) String

func (d Deployment) String() string

type DeploymentFilters added in v0.7.3

type DeploymentFilters struct {
	Owner sdk.AccAddress
	// State flag value given
	StateFlagVal string
	// Actual state value decoded from DeploymentStateMap
	State types.Deployment_State
}

DeploymentFilters defines flags for deployment list filter

func (DeploymentFilters) Accept added in v0.7.3

func (filters DeploymentFilters) Accept(obj types.Deployment, isValidState bool) bool

Accept returns whether deployment filters valid or not

type Deployments

type Deployments []Deployment

Deployments represents slice of deployment struct

func (Deployments) String

func (ds Deployments) String() string

type Group

type Group types.Group

Group stores group ID, state and other specifications

type GroupFilters added in v0.7.3

type GroupFilters struct {
	Owner sdk.AccAddress
	// State flag value given
	StateFlagVal string
	// Actual state value decoded from GroupStateMap
	State types.Group_State
}

GroupFilters defines flags for group list filter

type RawClient

type RawClient interface {
	Deployments(DeploymentFilters) ([]byte, error)
	Deployment(types.DeploymentID) ([]byte, error)
	Group(types.GroupID) ([]byte, error)
}

RawClient interface

func NewRawClient

func NewRawClient(ctx sdkclient.Context, key string) RawClient

NewRawClient creates a raw client instance with provided context and key

Jump to

Keyboard shortcuts

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