client

package
v1.17.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 20 Imported by: 27

Documentation

Index

Constants

View Source
const ApiKeyHeader = "x-api-key"

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthType added in v1.3.6

type AuthType int
const (
	None AuthType = iota
	JWT
	ApiKey
)

type Headers added in v1.3.6

type Headers map[string]string

func NewSubstreamsClientConn added in v1.17.0

func NewSubstreamsClientConn(config *SubstreamsClientConfig) (conn *grpc.ClientConn, closeFunc func() error, callOpts []grpc.CallOption, headers Headers, err error)

func NewSubstreamsInternalClient added in v1.0.2

func NewSubstreamsInternalClient(config *SubstreamsClientConfig) (cli pbssinternal.SubstreamsClient, closeFunc func() error, callOpts []grpc.CallOption, headers Headers, err error)

func (Headers) Append added in v1.3.6

func (h Headers) Append(headers map[string]string) map[string]string

func (Headers) IsSet added in v1.3.6

func (h Headers) IsSet() bool

func (Headers) ToArray added in v1.3.6

func (h Headers) ToArray() []string

type InternalClientFactory added in v1.0.2

type InternalClientFactory = func() (cli pbssinternal.SubstreamsClient, closeFunc func() error, callOpts []grpc.CallOption, headers Headers, err error)

func NewInternalClientFactory added in v1.0.2

func NewInternalClientFactory(config *SubstreamsClientConfig) InternalClientFactory

type ProtocolVersion added in v1.17.0

type ProtocolVersion int
const (
	ProtocolVersionUnset ProtocolVersion = 0
	ProtocolVersionV2    ProtocolVersion = 2
	ProtocolVersionV3    ProtocolVersion = 3
)

func ParseProtocolVersion added in v1.17.0

func ParseProtocolVersion(version int) (ProtocolVersion, error)

ParseProtocolVersion parses an integer to a ProtocolVersion

func (ProtocolVersion) IsUnset added in v1.17.0

func (pv ProtocolVersion) IsUnset() bool

func (ProtocolVersion) IsV2 added in v1.17.0

func (pv ProtocolVersion) IsV2() bool

func (ProtocolVersion) IsV3 added in v1.17.0

func (pv ProtocolVersion) IsV3() bool

func (ProtocolVersion) IsValid added in v1.17.0

func (pv ProtocolVersion) IsValid() bool

IsValid returns true if the protocol version is valid

func (ProtocolVersion) String added in v1.17.0

func (pv ProtocolVersion) String() string

String returns the string representation of the protocol version

type SubstreamsClientConfig added in v0.0.21

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

func NewSubstreamsClientConfig added in v0.0.21

func NewSubstreamsClientConfig(opts SubstreamsClientConfigOptions) *SubstreamsClientConfig

NewSubstreamsClientConfig creates a new SubstreamsClientConfig using the provided options. This function handles URL parsing for http:// and https:// schemes, automatically setting appropriate plaintext and port defaults.

Example usage:

config := client.NewSubstreamsClientConfig(client.NewSubstreamsClientConfigOptions{
    Endpoint:  "mainnet.eth.streamingfast.io:443",
    AuthToken: "your-auth-token",
    AuthType:  client.JWT,
    Agent:     "my-application",
})

func (*SubstreamsClientConfig) Agent added in v1.17.0

func (c *SubstreamsClientConfig) Agent() string

func (*SubstreamsClientConfig) AuthToken added in v1.3.6

func (c *SubstreamsClientConfig) AuthToken() string

func (*SubstreamsClientConfig) AuthType added in v1.3.6

func (c *SubstreamsClientConfig) AuthType() AuthType

func (*SubstreamsClientConfig) Endpoint added in v0.1.0

func (c *SubstreamsClientConfig) Endpoint() string

func (*SubstreamsClientConfig) ForceProtocolVersion added in v1.17.0

func (c *SubstreamsClientConfig) ForceProtocolVersion() ProtocolVersion

func (*SubstreamsClientConfig) Insecure added in v0.1.0

func (c *SubstreamsClientConfig) Insecure() bool

func (*SubstreamsClientConfig) MarshalLogObject added in v1.1.3

func (c *SubstreamsClientConfig) MarshalLogObject(encoder zapcore.ObjectEncoder) error

func (*SubstreamsClientConfig) PlainText added in v0.1.0

func (c *SubstreamsClientConfig) PlainText() bool

func (*SubstreamsClientConfig) SetAgent added in v1.17.0

func (c *SubstreamsClientConfig) SetAgent(agent string)

SetAgent sets the User-Agent header for gRPC requests made by this client, this can be set at any time but will be effective only before the `NewSubstreamsClient` is called, after that the changes to agent will **not** affect already created clients.

func (*SubstreamsClientConfig) SetEndpoint added in v1.10.0

func (c *SubstreamsClientConfig) SetEndpoint(endpoint string)

type SubstreamsClientConfigOptions added in v1.17.0

type SubstreamsClientConfigOptions struct {
	// Endpoint is the gRPC endpoint to connect to (e.g., "mainnet.eth.streamingfast.io:443")
	Endpoint string
	// AuthToken is the authentication token (JWT or API key)
	AuthToken string
	// AuthType specifies the type of authentication (None, JWT, or ApiKey)
	AuthType AuthType
	// Insecure allows insecure TLS connections (skips certificate verification)
	Insecure bool
	// PlainText uses unencrypted connections (no TLS)
	PlainText bool
	// Agent is the User-Agent string for gRPC requests
	Agent string
	// ForceProtocolVersion forces the use of a specific protocol version (2 or 3)
	ForceProtocolVersion ProtocolVersion
}

SubstreamsClientConfigOptions contains options for creating a new SubstreamsClientConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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