qldbsession

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: Apache-2.0 Imports: 7 Imported by: 6

Documentation

Overview

Package qldbsession provides the client and types for making API requests to QLDB Session.

The transactional data APIs for Amazon QLDB

Instead of interacting directly with this API, we recommend that you use the Amazon QLDB Driver or the QLDB Shell to execute data transactions on a ledger.

See https://docs.aws.amazon.com/goto/WebAPI/qldb-session-2019-07-11 for more information on this service.

See qldbsession package documentation for more information. https://docs.aws.amazon.com/sdk-for-go/api/service/qldbsession/

Using the Client

To use QLDB Session with the SDK use the New function to create a new service client. With that client you can make API requests to the service. These clients are safe to use concurrently.

See the SDK's documentation for more information on how to use the SDK. https://docs.aws.amazon.com/sdk-for-go/api/

See aws.Config documentation for more information on configuring SDK clients. https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config

See the QLDB Session client for more information on creating client for this service. https://docs.aws.amazon.com/sdk-for-go/api/service/qldbsession/#New

Index

Constants

View Source
const (
	ServiceName = "QLDB Session" // Service's name
	ServiceID   = "QLDBSession"  // Service's identifier
	EndpointsID = "session.qldb" // Service's Endpoint identifier
)
View Source
const (

	// ErrCodeBadRequestException for service response error code
	// "BadRequestException".
	//
	// Returned if the request is malformed or contains an error such as an invalid
	// parameter value or a missing required parameter.
	ErrCodeBadRequestException = "BadRequestException"

	// ErrCodeInvalidSessionException for service response error code
	// "InvalidSessionException".
	//
	// Returned if the session doesn't exist anymore because it timed out or expired.
	ErrCodeInvalidSessionException = "InvalidSessionException"

	// ErrCodeLimitExceededException for service response error code
	// "LimitExceededException".
	//
	// Returned if a resource limit such as number of active sessions is exceeded.
	ErrCodeLimitExceededException = "LimitExceededException"

	// ErrCodeOccConflictException for service response error code
	// "OccConflictException".
	//
	// Returned when a transaction cannot be written to the journal due to a failure
	// in the verification phase of optimistic concurrency control (OCC).
	ErrCodeOccConflictException = "OccConflictException"

	// ErrCodeRateExceededException for service response error code
	// "RateExceededException".
	//
	// Returned when the rate of requests exceeds the allowed throughput.
	ErrCodeRateExceededException = "RateExceededException"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AbortTransactionRequest

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

Contains the details of the transaction to abort.

func (AbortTransactionRequest) String

func (s AbortTransactionRequest) String() string

String returns the string representation

type AbortTransactionResult

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

Contains the details of the aborted transaction.

func (AbortTransactionResult) String

func (s AbortTransactionResult) String() string

String returns the string representation

type Client

type Client struct {
	*aws.Client
}

Client provides the API operation methods for making requests to QLDB Session. See this package's package overview docs for details on the service.

The client's methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

func New

func New(config aws.Config) *Client

New creates a new instance of the client from the provided Config.

Example:

// Create a client from just a config.
svc := qldbsession.New(myConfig)

func (*Client) SendCommandRequest

func (c *Client) SendCommandRequest(input *SendCommandInput) SendCommandRequest

SendCommandRequest returns a request value for making API operation for Amazon QLDB Session.

Sends a command to an Amazon QLDB ledger.

Instead of interacting directly with this API, we recommend that you use the Amazon QLDB Driver or the QLDB Shell to execute data transactions on a ledger.

  • If you are working with an AWS SDK, use the QLDB Driver. The driver provides a high-level abstraction layer above this qldbsession data plane and manages SendCommand API calls for you. For information and a list of supported programming languages, see Getting started with the driver (https://docs.aws.amazon.com/qldb/latest/developerguide/getting-started-driver.html) in the Amazon QLDB Developer Guide.

  • If you are working with the AWS Command Line Interface (AWS CLI), use the QLDB Shell. The shell is a command line interface that uses the QLDB Driver to interact with a ledger. For information, see Accessing Amazon QLDB using the QLDB Shell (https://docs.aws.amazon.com/qldb/latest/developerguide/data-shell.html).

    // Example sending a request using SendCommandRequest. req := client.SendCommandRequest(params) resp, err := req.Send(context.TODO()) if err == nil { fmt.Println(resp) }

Please also see https://docs.aws.amazon.com/goto/WebAPI/qldb-session-2019-07-11/SendCommand

type CommitTransactionRequest

type CommitTransactionRequest struct {

	// Specifies the commit digest for the transaction to commit. For every active
	// transaction, the commit digest must be passed. QLDB validates CommitDigest
	// and rejects the commit with an error if the digest computed on the client
	// does not match the digest computed by QLDB.
	//
	// CommitDigest is automatically base64 encoded/decoded by the SDK.
	//
	// CommitDigest is a required field
	CommitDigest []byte `type:"blob" required:"true"`

	// Specifies the transaction ID of the transaction to commit.
	//
	// TransactionId is a required field
	TransactionId *string `min:"22" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Contains the details of the transaction to commit.

func (CommitTransactionRequest) String

func (s CommitTransactionRequest) String() string

String returns the string representation

func (*CommitTransactionRequest) Validate

func (s *CommitTransactionRequest) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type CommitTransactionResult

type CommitTransactionResult struct {

	// The commit digest of the committed transaction.
	//
	// CommitDigest is automatically base64 encoded/decoded by the SDK.
	CommitDigest []byte `type:"blob"`

	// The transaction ID of the committed transaction.
	TransactionId *string `min:"22" type:"string"`
	// contains filtered or unexported fields
}

Contains the details of the committed transaction.

func (CommitTransactionResult) String

func (s CommitTransactionResult) String() string

String returns the string representation

type EndSessionRequest

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

Specifies a request to end the session.

func (EndSessionRequest) String

func (s EndSessionRequest) String() string

String returns the string representation

type EndSessionResult

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

Contains the details of the ended session.

func (EndSessionResult) String

func (s EndSessionResult) String() string

String returns the string representation

type ExecuteStatementRequest

type ExecuteStatementRequest struct {

	// Specifies the parameters for the parameterized statement in the request.
	Parameters []ValueHolder `type:"list"`

	// Specifies the statement of the request.
	//
	// Statement is a required field
	Statement *string `min:"1" type:"string" required:"true"`

	// Specifies the transaction ID of the request.
	//
	// TransactionId is a required field
	TransactionId *string `min:"22" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Specifies a request to execute a statement.

func (ExecuteStatementRequest) String

func (s ExecuteStatementRequest) String() string

String returns the string representation

func (*ExecuteStatementRequest) Validate

func (s *ExecuteStatementRequest) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ExecuteStatementResult

type ExecuteStatementResult struct {

	// Contains the details of the first fetched page.
	FirstPage *Page `type:"structure"`
	// contains filtered or unexported fields
}

Contains the details of the executed statement.

func (ExecuteStatementResult) String

func (s ExecuteStatementResult) String() string

String returns the string representation

type FetchPageRequest

type FetchPageRequest struct {

	// Specifies the next page token of the page to be fetched.
	//
	// NextPageToken is a required field
	NextPageToken *string `min:"4" type:"string" required:"true"`

	// Specifies the transaction ID of the page to be fetched.
	//
	// TransactionId is a required field
	TransactionId *string `min:"22" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Specifies the details of the page to be fetched.

func (FetchPageRequest) String

func (s FetchPageRequest) String() string

String returns the string representation

func (*FetchPageRequest) Validate

func (s *FetchPageRequest) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type FetchPageResult

type FetchPageResult struct {

	// Contains details of the fetched page.
	Page *Page `type:"structure"`
	// contains filtered or unexported fields
}

Contains the page that was fetched.

func (FetchPageResult) String

func (s FetchPageResult) String() string

String returns the string representation

type Page

type Page struct {

	// The token of the next page.
	NextPageToken *string `min:"4" type:"string"`

	// A structure that contains values in multiple encoding formats.
	Values []ValueHolder `type:"list"`
	// contains filtered or unexported fields
}

Contains details of the fetched page.

func (Page) String

func (s Page) String() string

String returns the string representation

type SendCommandInput

type SendCommandInput struct {

	// Command to abort the current transaction.
	AbortTransaction *AbortTransactionRequest `type:"structure"`

	// Command to commit the specified transaction.
	CommitTransaction *CommitTransactionRequest `type:"structure"`

	// Command to end the current session.
	EndSession *EndSessionRequest `type:"structure"`

	// Command to execute a statement in the specified transaction.
	ExecuteStatement *ExecuteStatementRequest `type:"structure"`

	// Command to fetch a page.
	FetchPage *FetchPageRequest `type:"structure"`

	// Specifies the session token for the current command. A session token is constant
	// throughout the life of the session.
	//
	// To obtain a session token, run the StartSession command. This SessionToken
	// is required for every subsequent command that is issued during the current
	// session.
	SessionToken *string `min:"4" type:"string"`

	// Command to start a new session. A session token is obtained as part of the
	// response.
	StartSession *StartSessionRequest `type:"structure"`

	// Command to start a new transaction.
	StartTransaction *StartTransactionRequest `type:"structure"`
	// contains filtered or unexported fields
}

func (SendCommandInput) String

func (s SendCommandInput) String() string

String returns the string representation

func (*SendCommandInput) Validate

func (s *SendCommandInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type SendCommandOutput

type SendCommandOutput struct {

	// Contains the details of the aborted transaction.
	AbortTransaction *AbortTransactionResult `type:"structure"`

	// Contains the details of the committed transaction.
	CommitTransaction *CommitTransactionResult `type:"structure"`

	// Contains the details of the ended session.
	EndSession *EndSessionResult `type:"structure"`

	// Contains the details of the executed statement.
	ExecuteStatement *ExecuteStatementResult `type:"structure"`

	// Contains the details of the fetched page.
	FetchPage *FetchPageResult `type:"structure"`

	// Contains the details of the started session that includes a session token.
	// This SessionToken is required for every subsequent command that is issued
	// during the current session.
	StartSession *StartSessionResult `type:"structure"`

	// Contains the details of the started transaction.
	StartTransaction *StartTransactionResult `type:"structure"`
	// contains filtered or unexported fields
}

func (SendCommandOutput) String

func (s SendCommandOutput) String() string

String returns the string representation

type SendCommandRequest

type SendCommandRequest struct {
	*aws.Request
	Input *SendCommandInput
	Copy  func(*SendCommandInput) SendCommandRequest
}

SendCommandRequest is the request type for the SendCommand API operation.

func (SendCommandRequest) Send

Send marshals and sends the SendCommand API request.

type SendCommandResponse

type SendCommandResponse struct {
	*SendCommandOutput
	// contains filtered or unexported fields
}

SendCommandResponse is the response type for the SendCommand API operation.

func (*SendCommandResponse) SDKResponseMetdata

func (r *SendCommandResponse) SDKResponseMetdata() *aws.Response

SDKResponseMetdata returns the response metadata for the SendCommand request.

type StartSessionRequest

type StartSessionRequest struct {

	// The name of the ledger to start a new session against.
	//
	// LedgerName is a required field
	LedgerName *string `min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Specifies a request to start a new session.

func (StartSessionRequest) String

func (s StartSessionRequest) String() string

String returns the string representation

func (*StartSessionRequest) Validate

func (s *StartSessionRequest) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type StartSessionResult

type StartSessionResult struct {

	// Session token of the started session. This SessionToken is required for every
	// subsequent command that is issued during the current session.
	SessionToken *string `min:"4" type:"string"`
	// contains filtered or unexported fields
}

Contains the details of the started session.

func (StartSessionResult) String

func (s StartSessionResult) String() string

String returns the string representation

type StartTransactionRequest

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

Specifies a request to start a transaction.

func (StartTransactionRequest) String

func (s StartTransactionRequest) String() string

String returns the string representation

type StartTransactionResult

type StartTransactionResult struct {

	// The transaction ID of the started transaction.
	TransactionId *string `min:"22" type:"string"`
	// contains filtered or unexported fields
}

Contains the details of the started transaction.

func (StartTransactionResult) String

func (s StartTransactionResult) String() string

String returns the string representation

type ValueHolder

type ValueHolder struct {

	// An Amazon Ion binary value contained in a ValueHolder structure.
	//
	// IonBinary is automatically base64 encoded/decoded by the SDK.
	IonBinary []byte `min:"1" type:"blob"`

	// An Amazon Ion plaintext value contained in a ValueHolder structure.
	IonText *string `min:"1" type:"string"`
	// contains filtered or unexported fields
}

A structure that can contain an Amazon Ion value in multiple encoding formats.

func (ValueHolder) String

func (s ValueHolder) String() string

String returns the string representation

func (*ValueHolder) Validate

func (s *ValueHolder) Validate() error

Validate inspects the fields of the type to determine if they are valid.

Directories

Path Synopsis
Package qldbsessioniface provides an interface to enable mocking the Amazon QLDB Session service client for testing your code.
Package qldbsessioniface provides an interface to enable mocking the Amazon QLDB Session service client for testing your code.

Jump to

Keyboard shortcuts

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