client

package
v2.4.0+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MasterGClient

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

func NewMasterGClient

func NewMasterGClient(addrs []string) *MasterGClient

func (*MasterGClient) Proxy

func (c *MasterGClient) Proxy(ctx context.Context, r *http.Request, header http.Header) (*Response, error)

func (*MasterGClient) Query

func (c *MasterGClient) Query(ctx context.Context, model string, req *Request) (*Result, error)

func (*MasterGClient) ValidatePassword

func (c *MasterGClient) ValidatePassword(ctx context.Context, userID string, password string) (*proto.UserInfo, error)

type Request

type Request struct {
	Query     string                 `json:"query"`
	Variables map[string]interface{} `json:"variables"`
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest(ctx context.Context, query string) *Request

func (*Request) Hander

func (r *Request) Hander(key string, value string)

func (*Request) Var

func (r *Request) Var(key string, value interface{})

type Response

type Response struct {
	Code   int      `json:"code"`
	Data   *Result  `json:"data"`
	Errors []string `json:"errors"`
}

type Result

type Result map[string]interface{}

func (Result) GetValue

func (r Result) GetValue(path ...string) interface{}

func (Result) GetValueByType

func (r Result) GetValueByType(v interface{}, path ...string) error

func (Result) String

func (r Result) String() string

type UserToken

type UserToken struct {
	UserID string
	Token  string
	Status bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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