Documentation
¶
Index ¶
- Constants
- type AuthType
- type Headers
- type InternalClientFactory
- type ProtocolVersion
- type SubstreamsClientConfig
- func (c *SubstreamsClientConfig) Agent() string
- func (c *SubstreamsClientConfig) AuthToken() string
- func (c *SubstreamsClientConfig) AuthType() AuthType
- func (c *SubstreamsClientConfig) Endpoint() string
- func (c *SubstreamsClientConfig) ForceProtocolVersion() ProtocolVersion
- func (c *SubstreamsClientConfig) Insecure() bool
- func (c *SubstreamsClientConfig) MarshalLogObject(encoder zapcore.ObjectEncoder) error
- func (c *SubstreamsClientConfig) PlainText() bool
- func (c *SubstreamsClientConfig) SetAgent(agent string)
- func (c *SubstreamsClientConfig) SetEndpoint(endpoint string)
- type SubstreamsClientConfigOptions
Constants ¶
const ApiKeyHeader = "x-api-key"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Headers ¶ added in v1.3.6
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)
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 ProtocolVersionV4 ProtocolVersion = 4 )
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) IsV4 ¶ added in v1.18.0
func (pv ProtocolVersion) IsV4() 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, 3 or 4)
ForceProtocolVersion ProtocolVersion
}
SubstreamsClientConfigOptions contains options for creating a new SubstreamsClientConfig