Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateInnerLogger(logFileName, isJsonType, logMaxSize, logFileBackupCount, allowLogLevel string) log.Logger
- func LocalIP() (net.IP, error)
- func PrintResult(i interface{})
- func ToJson(i interface{}) string
- type BadResponseError
- type Client
- type ClientConfig
- type ClientError
- type InvalidParamsError
- type MatchItem
- type ReadRequest
- type ReadResult
- type Response
- type Result
- type WriteRequest
- func (r *WriteRequest) AddContent(key string, value string) *WriteRequest
- func (r *WriteRequest) AddQueryParam(key string, value string) *WriteRequest
- func (r *WriteRequest) BuildUri() url.URL
- func (r *WriteRequest) SetQueryParams(params map[string]string) *WriteRequest
- func (r *WriteRequest) Validate() error
- type WriteResult
- type WriteType
Constants ¶
View Source
const (
REQUEST_METHOD = "GET"
)
Variables ¶
View Source
var Logger = initDefaultIgraphLogger()
Functions ¶
func GenerateInnerLogger ¶
func PrintResult ¶
func PrintResult(i interface{})
Types ¶
type BadResponseError ¶
BadResponseError define be http bad response error
func NewBadResponseError ¶
func NewBadResponseError(body string, header map[string][]string, httpCode int) *BadResponseError
func (BadResponseError) Error ¶
func (e BadResponseError) Error() string
func (BadResponseError) String ¶
func (e BadResponseError) String() string
type Client ¶
type Client struct { Endpoint string UserName string PassWord string Src string // contains filtered or unexported fields }
func (*Client) InitConfig ¶
func (c *Client) InitConfig(clientConfig ClientConfig)
func (*Client) WithRequestTimeout ¶
WithRequestTimeout with custom timeout for a request
type ClientConfig ¶
type ClientError ¶
type ClientError struct {
Message string `json:"errorMessage"`
}
ClientError defines be client error
func (ClientError) Error ¶
func (e ClientError) Error() string
func (ClientError) String ¶
func (e ClientError) String() string
type InvalidParamsError ¶
type InvalidParamsError struct {
Message string
}
func (InvalidParamsError) Error ¶
func (e InvalidParamsError) Error() string
func (InvalidParamsError) String ¶
func (e InvalidParamsError) String() string
type MatchItem ¶
type MatchItem struct { FieldNames []string `json:"field_names"` FieldValues [][]interface{} `json:"field_values"` }
type ReadRequest ¶
type ReadRequest struct { QueryString string `json:"query_string"` QueryParams map[string]string `json:"query_params"` }
func (*ReadRequest) AddQueryParam ¶
func (r *ReadRequest) AddQueryParam(key string, value string) *ReadRequest
func (*ReadRequest) BuildUri ¶
func (r *ReadRequest) BuildUri() string
func (*ReadRequest) SetQueryParams ¶
func (r *ReadRequest) SetQueryParams(params map[string]string) *ReadRequest
func (*ReadRequest) Validate ¶
func (r *ReadRequest) Validate() error
type ReadResult ¶
type WriteRequest ¶
type WriteRequest struct { WriteType WriteType `json:"write_type"` InstanceName string `json:"instance_name"` GraphName string `json:"graph_name"` LabelName string `json:"label_name"` Contents map[string]string `json:"contents"` PrimaryKey string `json:"primary_key"` SecondaryKey string `json:"secondary_key"` QueryParams map[string]string `json:"query_params"` }
func NewWriteRequest ¶
func (*WriteRequest) AddContent ¶
func (r *WriteRequest) AddContent(key string, value string) *WriteRequest
func (*WriteRequest) AddQueryParam ¶
func (r *WriteRequest) AddQueryParam(key string, value string) *WriteRequest
func (*WriteRequest) BuildUri ¶
func (r *WriteRequest) BuildUri() url.URL
func (*WriteRequest) SetQueryParams ¶
func (r *WriteRequest) SetQueryParams(params map[string]string) *WriteRequest
func (*WriteRequest) Validate ¶
func (r *WriteRequest) Validate() error
type WriteResult ¶
type WriteResult struct {
Errno int `json:"errno"`
}
Click to show internal directories.
Click to hide internal directories.