events

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:              "events",
	Short:            "Utilities to read events",
	TraverseChildren: true,
}
View Source
var GetCommand = &command.Command{
	Cmd: &cobra.Command{
		Use:     "get <event_name> <block_height_range_start> <optional:block_height_range_end|latest>",
		Short:   "Get events in a block range",
		Args:    cobra.RangeArgs(2, 3),
		Example: "flow events get A.1654653399040a61.FlowToken.TokensDeposited 11559500 11559600",
	},
	Flags: &generateFlag,
	Run: func(
		cmd *cobra.Command,
		args []string,
		globalFlags command.GlobalFlags,
		services *services.Services,
	) (command.Result, error) {
		if generateFlag.Verbose {
			fmt.Println("⚠️  DEPRECATION WARNING: verbose flag is deprecated")
		}

		end := ""
		if len(args) == 3 {
			end = args[2]
		}

		events, err := services.Events.Get(
			args[0],
			args[1],
			end,
		)
		if err != nil {
			return nil, err
		}

		return &EventResult{BlockEvents: events}, nil
	},
}

Functions

This section is empty.

Types

type EventResult

type EventResult struct {
	BlockEvents []client.BlockEvents
	Events      []flow.Event
}

EventResult result structure

func (*EventResult) JSON

func (k *EventResult) JSON() interface{}

JSON convert result to JSON

func (*EventResult) Oneliner

func (k *EventResult) Oneliner() string

Oneliner show result as one liner grep friendly

func (*EventResult) String

func (k *EventResult) String() string

String convert result to string

Jump to

Keyboard shortcuts

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