rest

package
v0.0.0-...-9ae4c5c Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeKey

func DecodeKey(keyEncoded string) (ledger.Key, error)

func DecodeKeys

func DecodeKeys(keysParam string) ([]ledger.Key, error)

func EncodeKey

func EncodeKey(key ledger.Key) string

func EncodeKeys

func EncodeKeys(keys []ledger.Key) string

Types

type Controller

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

func NewController

func NewController(state dps.State) (*Controller, error)

func (*Controller) GetRegister

func (c *Controller) GetRegister(ctx echo.Context) error

TODO: integration testing of GetRegister endpoint => https://github.com/awfm9/flow-dps/issues/48

func (*Controller) GetValue

func (c *Controller) GetValue(ctx echo.Context) error

GetValue returns the payload value of an encoded Ledger entry in the same way as the Flow Ledger interface would. It takes an input that emulates the `ledger.Query` struct, in the following way: - The parameter `keys` is a semicolon (`:`) delimited set of `ledger.Key` strings. - Each `ledger.KeyPart` within the `ledger.Key` is delimited by a comma (`,`). - The type and the value of each `ledger.KeyPart` are delimited by a colon (`.`). - The value is encoded as a hexadecimal string. Additionally, the state hash and the pathfinder key version can be given as query parameters. If omitted, the state hash of the latest sealed block and the default pathfinder key encoding will be used. The response is returned as a simple array of hexadecimal strings. Example: GET /values/0.f647acg,4.ef67d11:0.f3321ab,3.ab321fe?hash=7ae6417ed5&version=1 TODO: integration testing of GetValue endpoints => https://github.com/awfm9/flow-dps/issues/49

type RegisterResponse

type RegisterResponse struct {
	Height uint64 `json:"height"`
	Key    string `json:"key"`
	Value  string `json:"value"`
}

Jump to

Keyboard shortcuts

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