alego

package module
v0.0.0-...-e213341 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

alego

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aleo

type Aleo struct {
	Username string
	Password string
	URL      string
	// contains filtered or unexported fields
}

Aleo represents a separate Telegram Aleo instance.

func NewAleo

func NewAleo(pref Settings) (*Aleo, error)

NewAleo does try to build a Aleo Client with username `username` and password `password`, which is a secret API key assigned to particular Aleo node.

type BasicLogger

type BasicLogger struct{}

func (BasicLogger) Debug

func (BasicLogger) Debug(args ...interface{})

func (BasicLogger) Debugf

func (BasicLogger) Debugf(format string, args ...interface{})

func (BasicLogger) Error

func (BasicLogger) Error(args ...interface{})

func (BasicLogger) Errorf

func (BasicLogger) Errorf(format string, args ...interface{})

func (BasicLogger) Info

func (BasicLogger) Info(args ...interface{})

func (BasicLogger) Infof

func (BasicLogger) Infof(format string, args ...interface{})

func (BasicLogger) Print

func (BasicLogger) Print(args ...interface{})

func (BasicLogger) Printf

func (BasicLogger) Printf(format string, args ...interface{})

func (BasicLogger) Println

func (BasicLogger) Println(args ...interface{})

func (BasicLogger) Warn

func (BasicLogger) Warn(args ...interface{})

func (BasicLogger) Warnf

func (BasicLogger) Warnf(format string, args ...interface{})

type Client

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

Client is a low-level Telegram client

func NewClient

func NewClient(username string, pass string, baseURL string) *Client

NewClient creates new Telegram API client

func (*Client) DecodeRawTransaction

func (c *Client) DecodeRawTransaction(transaction_bytes string) (interface{}, error)

func (*Client) GetBestBlockHash

func (c *Client) GetBestBlockHash() (interface{}, error)

func (*Client) GetBlock

func (c *Client) GetBlock(hash string) (interface{}, error)

func (*Client) GetBlockCount

func (c *Client) GetBlockCount() (interface{}, error)

func (*Client) GetBlockHash

func (c *Client) GetBlockHash(block_height string) (interface{}, error)

func (*Client) GetBlockTemplate

func (c *Client) GetBlockTemplate() (interface{}, error)

func (*Client) GetConnectionCount

func (c *Client) GetConnectionCount() (interface{}, error)

func (*Client) GetNetworkGraph

func (c *Client) GetNetworkGraph() (interface{}, error)

func (*Client) GetNodeInfo

func (c *Client) GetNodeInfo() (rpcapi.NodeInfoResponse, error)

GetMe returns info about bot as a User object

func (*Client) GetNodePeers

func (c *Client) GetNodePeers() (rpcapi.GetPeerInfoResponse, error)

func (*Client) GetNodeStats

func (c *Client) GetNodeStats() (rpcapi.NodeStatsResponse, error)

func (*Client) GetRawTransaction

func (c *Client) GetRawTransaction(transaction_id string) (interface{}, error)

func (*Client) GetTransactionInfo

func (c *Client) GetTransactionInfo(transaction_id string) (interface{}, error)

func (*Client) SendTransaction

func (c *Client) SendTransaction(transaction_bytes string) (interface{}, error)

func (*Client) ValidateRawTransaction

func (c *Client) ValidateRawTransaction(transaction_bytes string) (interface{}, error)

type Logger

type Logger interface {
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Println(args ...interface{})
	Printf(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})

	Debug(args ...interface{})
	Info(args ...interface{})
	Print(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
}

Logger defines interface for any compatible logger

type Settings

type Settings struct {
	// Aleo API Url
	URL string

	// Aleo RPC username
	Username string

	// Aleo RPC password
	Password string

	// Synchronous prevents handlers from running in parallel.
	// It makes ProcessUpdate return after the handler is finished.
	Synchronous bool

	// Verbose forces Aleo to log all upcoming requests.
	// Use for debugging purposes only.
	Verbose bool

	// Reporter is a callback function that will get called
	// on any panics recovered from endpoint handlers.
	Reporter func(error)

	// HTTP Client used to make requests to ALEO node api
	Client *rpc2.Client

	// Offline allows to create a aleo without network for testing purposes.
	Offline bool
}

Settings represents a utility struct for passing certain properties of a Aleo around and is required to make Aleos.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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