agent

package module
v0.0.0-...-2befd3a Latest Latest
Warning

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

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

README

Go Agent for the Internet Computer

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(cfg ClientConfig) Client

func (Client) Status

func (c Client) Status() (Status, error)
Example
package main

import (
	"fmt"
	"net/url"

	"github.com/allusion-be/agent-go"
)

var ic0, _ = url.Parse("https://ic0.app/")

func main() {
	c := agent.NewClient(agent.ClientConfig{ic0})
	status, _ := c.Status()
	fmt.Println(status.Version)
}
Output:
0.18.0

type ClientConfig

type ClientConfig struct {
	Host *url.URL
}

type Implementation

type Implementation struct {
	// Source is the canonical location of the source code.
	Source string
	// Version is the version number of the implementation.
	Version string
	// Revision is the precise git revision of the implementation.
	Revision string
}

Implementation identifies the implementation of the Internet Computer.

type Status

type Status struct {
	// Identifies the interface version supported.
	Version string
	// Impl describes the implementation of the Internet Computer.
	Impl *Implementation
	// The public key (a DER-encoded BLS key) of the root key of this Internet Computer instance.
	RootKey []byte
}

Status describes various status fields of the Internet Computer.

func (*Status) UnmarshalCBOR

func (s *Status) UnmarshalCBOR(data []byte) error

Jump to

Keyboard shortcuts

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