graphsonv3

package
v0.0.0-...-0bd2a67 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The server successfully processed a request to completion - threr are no messages remaining in this stream
	RESPONSE_STATUS_SUCCESS = 200

	// The server processed the request but there is no result to return
	RESPONSE_STATUS_NO_CONTENT = 204

	// The server successfully returned some content, but there is more in the stream to arrive - wait for the end of the stream
	RESPONSE_STATUS_PARITAL_CONTENT = 206

	// The server could not authenticate the request or the client requested a resource it did not have access to
	RESPONSE_STATUS_UNAUTHORIZED = 401

	// The server could authenticate the request, but will not fulfill it
	RESPONSE_STATUS_FORBIDDEN = 403

	// A challenge from the server for the client to authenticate its request
	RESPONSE_STATUS_AUTHENTICATE = 407

	// The request message contains objects that were not serializable on the client side
	RESPONSE_STATUS_REQUEST_ERROR_SERIALIZATION = 497

	// The request message was not properly formatted which means it could not be parsed at all or the "op" code was
	// not recognized such that Gremlin Server could properly route it for processing.  Check the message format and
	// retry the request.
	RESPONSE_STATUS_REQUEST_ERROR_MALFORMED_REQUEST = 498

	// The request message was parseable, but the arguments supplied in the message were in conflict or incomplete.
	// Check the message format and retry the request.
	RESPONSE_STATUS_REQUEST_ERROR_INVALID_REQUEST_ARGUMENTS = 499

	// A general server error occurred that prevented the request from being processed
	RESPONSE_STATUS_SERVER_ERROR = 500

	// The script submitted for processing evaluated in the {@code ScriptEngine} with errors and could not be
	// processed.  Check the script submitted for syntax errors or other problems and then resubmit.
	RESPONSE_STATUS_SERVER_ERROR_SCRIPT_EVALUATION = 597

	// The server exceeded one of the timeout settings for the request and could therefore only partially responded
	// or did not respond at all.
	RESPONSE_STATUS_SERVER_ERROR_TIMEOUT = 598

	// The server was not capable of serializing an object that was returned from the script supplied on the request.
	// Either transform the object into something Gremlin Server can process within the script or install mapper
	// serialization classes to Gremlin Server.
	RESPONSE_STATUS_SERVER_ERROR_SERIALIZATION = 599

	// The client failed to deliver this request message to server
	RESPONSE_STATUS_REQUEST_ERROR_DELIVER = 697
)
View Source
const GraphsonV3 = "!application/vnd.gremlin-v3.0+json"

Variables

View Source
var (
	// GenUUID is a monkey patched function for the Google UUIDv4 generator.
	GenUUID = uuid.NewUUID
)

Functions

func GetResult

func GetResult(response *Response) ([]interface{}, error)

get result from one whole response

func SerializerRequest

func SerializerRequest(request *Request) ([]byte, error)

Types

type Request

type Request struct {
	RequestID string                 `json:"requestId"`
	Op        string                 `json:"op"`
	Processor string                 `json:"processor"`
	Args      map[string]interface{} `json:"args"`
}

func MakeAuthRequest

func MakeAuthRequest(requestId string, username string, password string) (*Request, error)

func MakeRequestCloseSession

func MakeRequestCloseSession(sessionId string) *Request

func MakeRequestWithOptions

func MakeRequestWithOptions(gremlin string, options *graph.RequestOptions) (*Request, error)

type Response

type Response struct {
	Data      interface{}
	RequestID string
	Code      int
}

func NewErrorResponse

func NewErrorResponse(requestId string, code int, err error) *Response

func ReadResponse

func ReadResponse(msg []byte) (*Response, error)

type ResponseFuture

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

func NewResponseFuture

func NewResponseFuture(request *Request, cb func() bool) *ResponseFuture

func (*ResponseFuture) Complete

func (r *ResponseFuture) Complete(response *Response)

func (*ResponseFuture) FixResponse

func (r *ResponseFuture) FixResponse(fn func(response *Response))

func (*ResponseFuture) Get

func (r *ResponseFuture) Get() *Response

func (*ResponseFuture) GetOrTimeout

func (r *ResponseFuture) GetOrTimeout(timeout time.Duration) (*Response, bool)

func (*ResponseFuture) IsCompleted

func (r *ResponseFuture) IsCompleted() bool

func (*ResponseFuture) Request

func (r *ResponseFuture) Request() *Request

Jump to

Keyboard shortcuts

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