Documentation ¶
Index ¶
- Constants
- Variables
- func CreateConnection() (conn net.Conn, server *url.URL, err error)
- func GraphSONSerializer(req *Request) ([]byte, error)
- func NewCluster(s ...string) (err error)
- type AuthInfo
- type Bind
- type Client
- type FormattedReq
- type OptAuth
- type Request
- type RequestArgs
- type Response
- type ResponseResult
- type ResponseStatus
Constants ¶
View Source
const ( // StatusSuccess ... StatusSuccess = 200 // StatusNoContent ... StatusNoContent = 204 // StatusPartialContent ... StatusPartialContent = 206 StatusUnauthorized = 401 // StatusAuthenticate ... StatusAuthenticate = 407 // StatusMalformedRequest ... StatusMalformedRequest = 498 // StatusInvalidRequestArguments ... StatusInvalidRequestArguments = 499 // StatusServerError ... StatusServerError = 500 // StatusScriptEvaluationError ... StatusScriptEvaluationError = 597 // StatusServerTimeout ... StatusServerTimeout = 598 // StatusServerSerializationError ... StatusServerSerializationError = 599 )
Variables ¶
View Source
var ErrorMsg = map[int]string{ StatusUnauthorized: "Unauthorized", StatusAuthenticate: "Authenticate", StatusMalformedRequest: "Malformed Request", StatusInvalidRequestArguments: "Invalid Request Arguments", StatusServerError: "Server Error", StatusScriptEvaluationError: "Script Evaluation Error", StatusServerTimeout: "Server Timeout", StatusServerSerializationError: "Server Serialization Error", }
ErrorMsg ...
Functions ¶
func GraphSONSerializer ¶
GraphSONSerializer ...
Types ¶
type AuthInfo ¶
AuthInfo includes all info related with SASL authentication with the Gremlin server
func NewAuthInfo ¶
NewAuthInfo is Constructor for different authentication possibilities
type Client ¶
Client include the necessary info to connect to the server and the underlying socket
func (*Client) Authenticate ¶
Authenticate ...
type FormattedReq ¶
type FormattedReq struct { Op string `json:"op"` RequestID interface{} `json:"requestId"` Args *RequestArgs `json:"args"` Processor string `json:"processor"` }
FormattedReq the requests in the appropriate way
type OptAuth ¶
OptAuth ...
func OptAuthEnv ¶
func OptAuthEnv() OptAuth
OptAuthEnv is Sets authentication info from environment variables GREMLIN_USER and GREMLIN_PASS
type Request ¶
type Request struct { RequestID string `json:"requestId"` Op string `json:"op"` Processor string `json:"processor"` Args *RequestArgs `json:"args"` }
Request ...
func (*Request) ManageTransaction ¶
ManageTransaction is args setter
func (*Request) SetProcessor ¶
SetProcessor is args setter
type RequestArgs ¶
type RequestArgs struct { Gremlin string `json:"gremlin,omitempty"` Session string `json:"session,omitempty"` Bindings Bind `json:"bindings,omitempty"` Language string `json:"language,omitempty"` Rebindings Bind `json:"rebindings,omitempty"` Sasl string `json:"sasl,omitempty"` BatchSize int `json:"batchSize,omitempty"` ManageTransaction bool `json:"manageTransaction,omitempty"` Aliases map[string]string `json:"aliases,omitempty"` }
RequestArgs ...
type Response ¶
type Response struct { RequestID string `json:"requestId"` Status *ResponseStatus `json:"status"` Result *ResponseResult `json:"result"` }
Response ...
type ResponseResult ¶
type ResponseResult struct { Data json.RawMessage `json:"data"` Meta map[string]interface{} `json:"meta"` }
ResponseResult ...
type ResponseStatus ¶
type ResponseStatus struct { Code int `json:"code"` Attributes map[string]interface{} `json:"attributes"` Message string `json:"message"` }
ResponseStatus ...
Click to show internal directories.
Click to hide internal directories.