godeltastream

package module
v0.0.0-...-210f5ba Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

README

go-deltastream

DeltaStream Golang database/sql driver for DeltaStream(http://deltastream.io).

DeltaStream is a fully managed stream processing platform powered by [Apache Flink®]

This module is in active development. DO NOT USE.


License

go-deltastream is distributed under the terms of the Apache License 2.0 license.

Documentation

Index

Constants

View Source
const (
	SqlStateSuccessfulCompletion = SqlState00000

	SqlStateWarning                   = SqlState01000
	SqlStatePrivilegeNotGranted       = SqlState01007
	SqlStatePrivilegeNotRevoked       = SqlState01006
	SqlStateStringDataRightTruncation = SqlState01004
	SqlStateDeprecatedFeature         = SqlState01P01

	SqlStateNoData = SqlState02000

	SqlStateSqlStatementNotYetComplete = SqlState03000

	SqlStateFeatureNotSupported = SqlState0A000

	SqlStateInvalidGrantor        = SqlState0L000
	SqlStateInvalidGrantOperation = SqlState0LP01

	SqlStateDependentObjectsStillExist = SqlState2BP01

	SqlStateInvalidUser                = SqlState3D000
	SqlStateInvalidRole                = SqlState3D001
	SqlStateInvalidDatabase            = SqlState3D002
	SqlStateInvalidSchema              = SqlState3D003
	SqlStateInvalidOrganization        = SqlState3D004
	SqlStateInvalidRegion              = SqlState3D005
	SqlStateInvalidStore               = SqlState3D006
	SqlStateInvalidTopic               = SqlState3D007
	SqlStateInvalidParameter           = SqlState3D008
	SqlStateInvalidSchemaRegistry      = SqlState3D009
	SqlStateInvalidDescriptor          = SqlState3D010
	SqlStateInvalidDescriptorSource    = SqlState3D011
	SqlStateInvalidApiToken            = SqlState3D012
	SqlStateInvalidSecurityIntegration = SqlState3D013
	SqlStateInvalidMetricsIntegration  = SqlState3D014
	SqlStateInvalidSandbox             = SqlState3D015
	SqlStateInvalidSecret              = SqlState3D016
	SqlStateInvalidFunction            = SqlState3D017
	SqlStateInvalidFunctionSource      = SqlState3D018
	SqlStateInvalidQuery               = SqlState3D019
	SqlStateInvalidRelation            = SqlState3D020
	SqlStateMissingParameter           = SqlState3D021

	SqlStateStoreNotReady          = SqlState3E001
	SqlStateSchemaRegistryNotReady = SqlState3E002
	SqlStateRelationNotReady       = SqlState3E003

	SqlStateInsufficientPrivilege        = SqlState42501
	SqlStateSyntaxError                  = SqlState42601
	SqlStateNameTooLong                  = SqlState42622
	SqlStateDuplicateObject              = SqlState42710
	SqlStateDuplicateDatabase            = SqlState42P04
	SqlStateDuplicateStore               = SqlState42P05
	SqlStateDuplicateSchema              = SqlState42P06
	SqlStateDuplicateUser                = SqlState42P07
	SqlStateDuplicateTopicDescriptor     = SqlState42P08
	SqlStateDuplicateApiToken            = SqlState42P09
	SqlStateDuplicateSecurityIntegration = SqlState42P10
	SqlStateDuplicateRole                = SqlState42P11
	SqlStateDuplicateMetricsIntegration  = SqlState42P12
	SqlStateDuplicateSandbox             = SqlState42P13
	SqlStateDuplicateSecret              = SqlState42P14
	SqlStateDuplicateFunction            = SqlState42P15
	SqlStateDuplicateFunctionSource      = SqlState42P16
	SqlStateAmbiguousOrganization        = SqlState42P001
	SqlStateAmbiguousStore               = SqlState42P002

	SqlStateConfigurationLimitExceeded = SqlState53000

	SqlStateInternalError = SqlStateXX000
	SqlStateUndefined     = SqlStateXX001

	SqlStateCancelled         = SqlState57000
	SqlStateTimeout           = SqlState57014
	SqlStateRemoteUnavailable = SqlState57015
)

Variables

View Source
var ErrAuthenticationError = fmt.Errorf("error while authenticating with server")
View Source
var ErrDeadlineExceeded = fmt.Errorf("deadline exceeded")
View Source
var ErrNotSupported = &ErrClientError{message: "feature is not supported"}
View Source
var ErrServiceUnavailable = fmt.Errorf("service temporarily unavailable")

Functions

func ConnectorWithOptions

func ConnectorWithOptions(ctx context.Context, options ...ConnectionOption) (*connector, error)

OpenWithHTTPClient returns a new connection to the database. The returned connection must only used by one goroutine at a time.

func Open

func Open(connStr string) (driver.Conn, error)

Open returns a new connection to the database. (sql.DB compatibility)

func WithAttachment

func WithAttachment(ctx context.Context, paramName string, r io.ReadCloser) context.Context

func WithAuthClient

func WithAuthClient(authClient AuthClient) func(*connectionOptions)

func WithHTTPClient

func WithHTTPClient(client *http.Client) func(*connectionOptions)

func WithInsecureTLS

func WithInsecureTLS() func(*connectionOptions)

func WithServer

func WithServer(server string) func(*connectionOptions)

func WithSessionID

func WithSessionID(sessionID string) func(*connectionOptions)

func WithStaticToken

func WithStaticToken(token string) func(*connectionOptions)

Types

type AuthClient

type AuthClient interface {
	Login(context.Context) (*TokenInfo, error)
	RefreshToken(ctx context.Context, refreshToken string) (*TokenInfo, error)
}

type AuthMessage

type AuthMessage struct {
	Type        string `json:"type"`
	AccessToken string `json:"accessToken"`
	SessionID   string `json:"sessionId"`
}

type Conn

type Conn struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Conn) Begin

func (*Conn) Begin() (driver.Tx, error)

func (*Conn) Close

func (c *Conn) Close() error

Close implements driver.Conn.

func (*Conn) Exec

func (c *Conn) Exec(query string, args []driver.Value) (driver.Result, error)

func (*Conn) ExecContext

func (c *Conn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error)

func (*Conn) GetContext

func (c *Conn) GetContext() apiv2.ResultSetContext

func (*Conn) Ping

func (c *Conn) Ping(ctx context.Context) error

func (*Conn) Prepare

func (c *Conn) Prepare(query string) (driver.Stmt, error)

Prepare implements driver.Conn.

func (*Conn) Query

func (c *Conn) Query(query string, args []driver.Value) (driver.Rows, error)

func (*Conn) QueryContext

func (c *Conn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error)

type ConnectionOption

type ConnectionOption func(*connectionOptions)

type DPConn

type DPConn struct {
	apiv2.DataplaneRequest
	// contains filtered or unexported fields
}

func NewDPConn

func NewDPConn(dpreq apiv2.DataplaneRequest, sessionID *string, httpClient *http.Client) (*DPConn, error)

type Driver

type Driver struct{}

Driver is the DeltaStream database driver.

func (Driver) Open

func (Driver) Open(name string) (driver.Conn, error)

Open returns a new connection to the database. (sql.DB compatibility)

func (Driver) OpenConnector

func (Driver) OpenConnector(connStr string) (driver.Connector, error)

OpenConnector parses the connection string and returns a new connector.

type ErrClientError

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

ErrClientError is raised when client has an internal error while processing a message

func (*ErrClientError) Error

func (e *ErrClientError) Error() string

func (*ErrClientError) Unwrap

func (e *ErrClientError) Unwrap() error

type ErrInterfaceError

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

ErrInterfaceError is raised when there is a mismatch between the expected interface between client and server

func (*ErrInterfaceError) Error

func (e *ErrInterfaceError) Error() string

func (*ErrInterfaceError) Unwrap

func (e *ErrInterfaceError) Unwrap() error

type ErrSQLError

type ErrSQLError struct {
	SQLCode     SqlState
	Message     string
	StatementID uuid.UUID
}

func (ErrSQLError) Error

func (e ErrSQLError) Error() string

type ErrServerError

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

ErrServerError is raised when server has an internal error while processing a message

func (*ErrServerError) Error

func (e *ErrServerError) Error() string

type ErrStatementClosed

type ErrStatementClosed struct{}

func (*ErrStatementClosed) Error

func (*ErrStatementClosed) Error() string

type PrintTopicColumn

type PrintTopicColumn struct {
	Name      string `json:"name"`
	Nullable  bool   `json:"nullable,omitempty"`
	Type      string `json:"type"`
	Length    int64  `json:"length,omitempty"`
	Precision int64  `json:"precision,omitempty"`
	Scale     int64  `json:"scale,omitempty"`
}

type PrintTopicDataMessage

type PrintTopicDataMessage struct {
	Type    string            `json:"type"`
	Headers map[string]string `json:"headers"`
	Data    []*string         `json:"data"`
}

type PrintTopicErrorMessage

type PrintTopicErrorMessage struct {
	Type    string            `json:"type"`
	Headers map[string]string `json:"headers"`
	Message string            `json:"message"`
	SqlCode SqlState          `json:"sqlCode"`
}

type PrintTopicMessage

type PrintTopicMessage struct {
	Type     string                    `json:"type"`
	Err      PrintTopicErrorMessage    `json:"-"`
	Metadata PrintTopicMetadataMessage `json:"-"`
	Data     PrintTopicDataMessage     `json:"-"`
}

func (*PrintTopicMessage) UnmarshalJSON

func (m *PrintTopicMessage) UnmarshalJSON(b []byte) error

type PrintTopicMetadataMessage

type PrintTopicMetadataMessage struct {
	Type    string             `json:"type"`
	Headers map[string]string  `json:"headers"`
	Columns []PrintTopicColumn `json:"columns"`
}

type ResultSetConn

type ResultSetConn interface {
	// contains filtered or unexported methods
}

type SqlState

type SqlState string
const (
	SqlState00000  SqlState = "00000"
	SqlState01000  SqlState = "01000"
	SqlState01004  SqlState = "01004"
	SqlState01006  SqlState = "01006"
	SqlState01007  SqlState = "01007"
	SqlState01P01  SqlState = "01P01"
	SqlState02000  SqlState = "02000"
	SqlState03000  SqlState = "03000"
	SqlState0A000  SqlState = "0A000"
	SqlState0L000  SqlState = "0L000"
	SqlState0LP01  SqlState = "0LP01"
	SqlState2BP01  SqlState = "2BP01"
	SqlState3D000  SqlState = "3D000"
	SqlState3D001  SqlState = "3D001"
	SqlState3D002  SqlState = "3D002"
	SqlState3D003  SqlState = "3D003"
	SqlState3D004  SqlState = "3D004"
	SqlState3D005  SqlState = "3D005"
	SqlState3D006  SqlState = "3D006"
	SqlState3D007  SqlState = "3D007"
	SqlState3D008  SqlState = "3D008"
	SqlState3D009  SqlState = "3D009"
	SqlState3D010  SqlState = "3D010"
	SqlState3D011  SqlState = "3D011"
	SqlState3D012  SqlState = "3D012"
	SqlState3D013  SqlState = "3D013"
	SqlState3D014  SqlState = "3D014"
	SqlState3D015  SqlState = "3D015"
	SqlState3D016  SqlState = "3D016"
	SqlState3D017  SqlState = "3D017"
	SqlState3D018  SqlState = "3D018"
	SqlState3D019  SqlState = "3D019"
	SqlState3D020  SqlState = "3D020"
	SqlState3D021  SqlState = "3D021"
	SqlState3E001  SqlState = "3E001"
	SqlState3E002  SqlState = "3E002"
	SqlState3E003  SqlState = "3E003"
	SqlState42501  SqlState = "42501"
	SqlState42601  SqlState = "42601"
	SqlState42622  SqlState = "42622"
	SqlState42710  SqlState = "42710"
	SqlState42P04  SqlState = "42P04"
	SqlState42P05  SqlState = "42P05"
	SqlState42P06  SqlState = "42P06"
	SqlState42P07  SqlState = "42P07"
	SqlState42P08  SqlState = "42P08"
	SqlState42P09  SqlState = "42P09"
	SqlState42P10  SqlState = "42P010"
	SqlState42P11  SqlState = "42P011"
	SqlState42P12  SqlState = "42P012"
	SqlState42P13  SqlState = "42P013"
	SqlState42P14  SqlState = "42P014"
	SqlState42P15  SqlState = "42P015"
	SqlState42P16  SqlState = "42P016"
	SqlState42P001 SqlState = "42P001"
	SqlState42P002 SqlState = "42P002"
	SqlState57014  SqlState = "57014"
	SqlState57015  SqlState = "57015"
	SqlState57000  SqlState = "57000"
	SqlState53000  SqlState = "53000"
	SqlStateXX000  SqlState = "XX000"
	SqlStateXX001  SqlState = "XX001"
)

type TokenInfo

type TokenInfo struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	TokenType    string `json:"token_type"`
	// Note that auth0 returns expires_in (seconds). We translate to a time when getting
	// token back from server
	ExpiresAt uint64 `json:"expires_at"`
}

type TokenManager

type TokenManager interface {
	// If access token is empty will call through login flow. If access token
	// has expired it will request a new one using refresh token
	GetToken(context.Context) (string, error)
	// From oauth2.TokenSource
	Token() (*oauth2.Token, error)
}

func NewStaticTokenManager

func NewStaticTokenManager(ctx context.Context, token string) TokenManager

func NewTokenManager

func NewTokenManager(ctx context.Context, authClient AuthClient) TokenManager

Directories

Path Synopsis
Package apiv2 provides primitives to interact with the openapi HTTP API.
Package apiv2 provides primitives to interact with the openapi HTTP API.
Package dpapiv2 provides primitives to interact with the openapi HTTP API.
Package dpapiv2 provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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