Documentation
¶
Overview ¶
package client implements Juno client API.
Possible returned errors.
Common Errors * nil * ErrBadMsg * ErrBadParam * ErrBusy * ErrConnect * ErrInternal * ErrNoStorage * ErrResponseTimeout Create * Common Errors * ErrRecordLocked * ErrWriteFailure * ErrUniqueKeyViolation Get * Common Errors * ErrNoKey // Normal if key has not been created or has expired. * ErrTTLExtendFailure Update * Common Errors * ErrConditionViolation * ErrRecordLocked * ErrWriteFailure Set * Common Errors * ErrRecordLocked * ErrWriteFailure Destroy * Common Errors * ErrRecordLocked * ErrWriteFailure
Package client provides interfaces and implementations for communicating with a Juno server.
Package client handles the configuration for a Juno client.
client is a package that handles various error situations in the Juno application.
Package client provides functionalities for client configurations.
Example (NewClient) ¶
package main import ( "fmt" "github.com/paypal/junodb/pkg/client" ) func main() { // create a Juno client talking to 127.0.0.1:8080 with // namespace: exampleNS, and // applicaiton name: exampleApp if cli, err := client.NewClient("127.0.0.1:8080", "exampleNS", "exampleApp"); err == nil { cli.Get([]byte("aKey")) } else { fmt.Println(err) } }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConnect error ErrResponseTimeout error ErrNoKey error ErrUniqueKeyViolation error ErrBadParam error ErrConditionViolation error ErrBadMsg error // Error when a bad message is encountered. ErrNoStorage error // Error when no storage is available. ErrRecordLocked error // Error when a record is locked. ErrTTLExtendFailure error // Error when TTL extension fails. ErrBusy error // Error when the server is busy. ErrWriteFailure error // Error when a write operation fails. ErrInternal error // Error when an internal problem occurs. ErrOpNotSupported error // Error when the operation is not supported. )
Error variables for different scenarios in the application.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Server io.ServiceEndpoint Appname string Namespace string DefaultTimeToLive int ConnPoolSize int ConnectTimeout Duration ResponseTimeout Duration BypassLTM bool Cal cal.Config }
Config holds the configuration values for the Juno client.
type IClient ¶
type IClient interface { Create(key []byte, value []byte, opts ...IOption) (IContext, error) Get(key []byte, opts ...IOption) ([]byte, IContext, error) Update(key []byte, value []byte, opts ...IOption) (IContext, error) Set(key []byte, value []byte, opts ...IOption) (IContext, error) Destroy(key []byte, opts ...IOption) (err error) UDFGet(key []byte, fname []byte, params []byte, opts ...IOption) ([]byte, IContext, error) UDFSet(key []byte, fname []byte, params []byte, opts ...IOption) (IContext, error) }
Click to show internal directories.
Click to hide internal directories.