Documentation ¶
Index ¶
- type BaseBuilder
- func (cb *BaseBuilder) Build(ctx context.Context) (*grpc.ClientConn, error)
- func (cb *BaseBuilder) Headers() map[string]string
- func (cb *BaseBuilder) Host() string
- func (cb *BaseBuilder) Port() int
- func (cb *BaseBuilder) SessionId() string
- func (cb *BaseBuilder) Token() string
- func (cb *BaseBuilder) User() string
- type Builder
- type ChannelBuilderdeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseBuilder ¶
type BaseBuilder struct {
// contains filtered or unexported fields
}
BaseBuilder is used to parse the different parameters of the connection string according to the specification documented here:
https://github.com/apache/spark/blob/master/connector/connect/docs/client-connection-string.md
func NewBuilder ¶
func NewBuilder(connection string) (*BaseBuilder, error)
NewBuilder creates a new instance of the BaseBuilder. This constructor effectively parses the connection string and extracts the relevant parameters directly.
The following parameters to the connection string are reserved: user_id, session_id, use_ssl, and token. These parameters are not allowed to be injected as headers.
func (*BaseBuilder) Build ¶
func (cb *BaseBuilder) Build(ctx context.Context) (*grpc.ClientConn, error)
Build finalizes the creation of the gprc.ClientConn by creating a GRPC channel with the necessary options extracted from the connection string. For TLS connections, this function will load the system certificates.
func (*BaseBuilder) Headers ¶
func (cb *BaseBuilder) Headers() map[string]string
func (*BaseBuilder) Host ¶
func (cb *BaseBuilder) Host() string
func (*BaseBuilder) Port ¶
func (cb *BaseBuilder) Port() int
func (*BaseBuilder) SessionId ¶
func (cb *BaseBuilder) SessionId() string
func (*BaseBuilder) Token ¶
func (cb *BaseBuilder) Token() string
func (*BaseBuilder) User ¶
func (cb *BaseBuilder) User() string
type Builder ¶
type Builder interface { // Build creates the grpc.ClientConn according to the configuration of the builder. // Implementations are free to provide additional paramters in their implementation // and simply must satisfy this minimal set of requirements. Build(ctx context.Context) (*grpc.ClientConn, error) // User identifies the username passed as part of the Spark Connect requests. User() string // Headers refers to the request metadata that is passed for every request from the // client to the server. Headers() map[string]string // SessionId identifies the client side session identifier. This value must be a UUID formatted // as a string. SessionId() string }
Builder is the interface that is used to implement different patterns that create the GRPC connection.
This allows other consumers to plugin custom authentication and authorization handlers without having to extend directly the Spark Connect code.
type ChannelBuilder
deprecated
type ChannelBuilder = BaseBuilder
ChannelBuilder re-exports BaseBuilder as its previous name for compatibility.
Deprecated: use BaseBuilder instead.