Documentation ¶
Index ¶
- Constants
- Variables
- func HostNameandPort(node string) (host, port string, ipv6 bool, err error)
- func IsIPv6(str string) (bool, error)
- func Open(dataSourceName string) (godbc.DB, error)
- func OpenN1QLConnection(name string, userAgent string) (*n1qlConn, error)
- func SetCBUserAgentHeader(v string)
- func SetCaFile(cacert string)
- func SetCertFile(cert string)
- func SetIsAnalytics(val bool)
- func SetKeyFile(key string)
- func SetNetworkType(networkType string)
- func SetPassthroughMode(val bool)
- func SetPrivateKeyPassphrase(passphrase []byte)
- func SetQueryParams(key string, value string) error
- func SetSkipVerify(skip bool)
- func SetTxTimeout(value string)
- func SetUsernamePassword(u, p string)
- func UnsetQueryParams(key string) error
- type N1qlDB
- type N1qlStmt
Constants ¶
View Source
const ( TX_NONE = iota TX_START TX_COMMIT TX_ROLLBACK )
Variables ¶
View Source
var ( ErrNotSupported = fmt.Errorf("N1QL: Not supported") ErrNotImplemented = fmt.Errorf("N1QL: Not implemented") ErrUnknownCommand = fmt.Errorf("N1QL: Unknown Command") ErrInternalError = fmt.Errorf("N1QL: Internal Error") )
Common error codes
View Source
var ( N1QL_SERVICE_ENDPOINT = "/query/service" N1QL_DEFAULT_HOST = "127.0.0.1" N1QL_DEFAULT_PORT = 8093 N1QL_POOL_SIZE = 2 ^ 10 // 1 MB N1QL_DEFAULT_STATEMENT = "SELECT RAW 1;" LOCALHOST = N1QL_DEFAULT_HOST )
defaults
View Source
var HTTPClient = &http.Client{Transport: HTTPTransport}
View Source
var HTTPTransport = &http.Transport{MaxIdleConnsPerHost: MaxIdleConnsPerHost}
View Source
var MaxIdleConnsPerHost = 10
HTTPClient to use for REST and view operations.
View Source
var (
N1QL_PASSTHROUGH_MODE = false
)
View Source
var QueryParams map[string]string
Rest API query parameters
View Source
var TxTimeout string
Functions ¶
func HostNameandPort ¶
Return hostname and port for IPv4 and IPv6
func OpenN1QLConnection ¶
func SetCBUserAgentHeader ¶
func SetCBUserAgentHeader(v string)
func SetCertFile ¶
func SetCertFile(cert string)
func SetIsAnalytics ¶
func SetIsAnalytics(val bool)
func SetKeyFile ¶
func SetKeyFile(key string)
func SetNetworkType ¶
func SetNetworkType(networkType string)
func SetPassthroughMode ¶
func SetPassthroughMode(val bool)
func SetPrivateKeyPassphrase ¶
func SetPrivateKeyPassphrase(passphrase []byte)
func SetQueryParams ¶
func SetSkipVerify ¶
func SetSkipVerify(skip bool)
func SetTxTimeout ¶
func SetTxTimeout(value string)
func SetUsernamePassword ¶
func SetUsernamePassword(u, p string)
func UnsetQueryParams ¶
Types ¶
type N1qlDB ¶
type N1qlDB interface { godbc.DB PrepareExtended(query string) (N1qlStmt, error) // Run the query with the given parameters. // Returns the raw streaming input from the body of the RESTful request // to the database. The returned error contains a short description // of what went wrong with the query. // // Note that under some conditions, where the request was actually sent to the // server, both the stream and an error are returned. QueryRaw(query string, args ...interface{}) (io.ReadCloser, error) // Execute the statement with the given parameters. // Returns the raw streaming input from the body of the RESTful request // to the database. The returned error contains a short description // of what went wrong with the query. // // Note that under some conditions, where the request was actually sent to the // server, both the stream and an error are returned. ExecRaw(query string, args ...interface{}) (io.ReadCloser, error) }
type N1qlStmt ¶
type N1qlStmt interface { godbc.Stmt QueryRaw(args ...interface{}) (io.ReadCloser, error) ExecRaw(args ...interface{}) (io.ReadCloser, error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.