Categorygithub.com/streamingfast/client-go
modulepackage
0.2.0
Repository: https://github.com/streamingfast/client-go.git
Documentation: pkg.go.dev

# README

StreamingFast Golang Client Library

A GraphQL client library to consume dfuse API https://streamingfast.io (dfuse docs).

Installation

go get github.com/streamingfast/client-go

Features

What you get by using this library:

  • StreamingFast API Token issuance & management (auto-refresh, expiration handling, storage, etc)
  • StreamingFast GraphQL over gRPC API (planned)
  • StreamingFast gRPC API helpers (planned)

Quick Start

Notice You should replace the sequence of characters Paste your API key here in the script above with your actual API key obtained from https://app.dfuse.io. You are connecting to a local unauthenticated dfuse instance or to a dfuse Community Edition (EOSIO only)? Replace apiKey: "<Paste your API key here>" pass option dfuse.WithoutAuthentication when creating your client.

Common

package main

import (

)

func main() {
    client, err := StreamingFast.NewClient("mainnet.eos.dfuse.io", "<Paste your API key here>")
    if err != nil { panic(err) }

    tokenInfo, err := client.GetAPITokenInfo(context.Background())
    if err != nil { panic(err) }

    // Use `tokenInfo.Token` and use it to connect to dfuse's API (`fmt.Sprintf("Bearer %s", tokenInfo.Token)`)
}

References

Contributing

Issues and PR in this repo related strictly to the Golang client library.

Report any protocol-specific issues in their respective repositories

Please first refer to the general StreamingFast contribution guide, if you wish to contribute to this code base.

This codebase uses unit tests extensively, please write and run tests.

License

Apache 2.0

# Packages

No description provided by the author

# Functions

No description provided by the author
NewFileAPITokenStore creates a new FileAPITokenStore instance using the given `filePath`.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WithGRPCPort is an option that can be used to overidde all heuristics performed by the client to infer the gRPC port to use based on the network.
WithInsecure is an option that can be used to notify the client that it should use an insecure TLS connection for gRPC calls.
No description provided by the author
WithoutAuthentication disables API token retrieval and management assuming the endpoint connecting to does not require authentication.
WithPlainText is an option that can be used to notify the client that it should use a plain text connection (so non-TLS) for gRPC calls.

# Structs

No description provided by the author
FileAPITokenStore saves the active token as a JSON string in plain text in the given file.
InMemoryAPITokenStore simply keeps the token in memory and serves it from there.
OnDiskAPITokenStore saves the active token as a JSON string in a file located at `~/.dfuse/<sha256-api-key>/token.json`.

# Interfaces

No description provided by the author
No description provided by the author
No description provided by the author
ExperimentalClient is an interface implemented by the client you received when doing `NewClient` but the method in there are **experimental**, the API could change or removed at any moment.
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
GraphQLVariables option to pass.