gclientx

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 19 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHttpError added in v0.8.1

func NewHttpError(statusCode int, statusText string) error

Types

type Client

type Client struct {
	*gclient.Client
	// contains filtered or unexported fields
}

func New

func New(client ...*gclient.Client) *Client

func (*Client) BasicAuth added in v0.3.1

func (c *Client) BasicAuth(user, pass string) *Client

func (*Client) Clone added in v0.3.1

func (c *Client) Clone() *Client

func (*Client) ConnectBytes added in v0.8.0

func (c *Client) ConnectBytes(ctx context.Context, url string, data ...interface{}) ([]byte, error)

func (*Client) ConnectContent added in v0.8.0

func (c *Client) ConnectContent(ctx context.Context, url string, data ...interface{}) (string, error)

func (*Client) ConnectEventSource added in v0.4.3

func (c *Client) ConnectEventSource(ctx context.Context, url string, data ...interface{}) EventSource

func (*Client) ConnectVar added in v0.8.0

func (c *Client) ConnectVar(ctx context.Context, url string, data ...interface{}) (*gvar.Var, error)

func (*Client) ContentForm added in v0.3.1

func (c *Client) ContentForm() *Client

func (*Client) ContentJson added in v0.3.1

func (c *Client) ContentJson() *Client

func (*Client) ContentType added in v0.3.1

func (c *Client) ContentType(contentType string) *Client

func (*Client) ContentXml added in v0.3.1

func (c *Client) ContentXml() *Client

func (*Client) Cookie added in v0.3.1

func (c *Client) Cookie(key, value string) *Client

func (*Client) CookieMap added in v0.8.7

func (c *Client) CookieMap(m map[string]string) *Client

func (*Client) DeleteBytes added in v0.8.0

func (c *Client) DeleteBytes(ctx context.Context, url string, data ...interface{}) ([]byte, error)

func (*Client) DeleteContent added in v0.8.0

func (c *Client) DeleteContent(ctx context.Context, url string, data ...interface{}) (string, error)

func (*Client) DeleteEventSource added in v0.4.3

func (c *Client) DeleteEventSource(ctx context.Context, url string, data ...interface{}) EventSource

func (*Client) DeleteVar added in v0.8.0

func (c *Client) DeleteVar(ctx context.Context, url string, data ...interface{}) (*gvar.Var, error)

func (*Client) Discovery added in v0.3.1

func (c *Client) Discovery(discovery gsvc.Discovery) *Client

func (*Client) DoRawContentRequest added in v0.8.5

func (c *Client) DoRawContentRequest(ctx context.Context, content string) (response *http.Response, err error)

func (*Client) DoRawFnRequest added in v0.8.5

func (c *Client) DoRawFnRequest(ctx context.Context, rawFn func(context.Context) (string, error)) (response *http.Response, err error)

func (*Client) DoTmplRequest added in v0.8.4

func (c *Client) DoTmplRequest(ctx context.Context,
	view *gviewx.View, key string, params ...gview.Params) (*http.Response, error)

func (*Client) EventSource added in v0.4.3

func (c *Client) EventSource(ctx context.Context, method string, url string, data ...interface{}) EventSource

func (*Client) GetBasicAuth added in v0.8.7

func (c *Client) GetBasicAuth() (string, string)

func (*Client) GetBytes

func (c *Client) GetBytes(ctx context.Context, url string, data ...interface{}) ([]byte, error)

func (*Client) GetContent

func (c *Client) GetContent(ctx context.Context, url string, data ...interface{}) (string, error)

func (*Client) GetCookie added in v0.8.7

func (c *Client) GetCookie(key string) string

func (*Client) GetCookieMap added in v0.8.7

func (c *Client) GetCookieMap() map[string]string

func (*Client) GetEventSource added in v0.4.3

func (c *Client) GetEventSource(ctx context.Context, url string, data ...interface{}) EventSource

func (*Client) GetHeader added in v0.8.7

func (c *Client) GetHeader(key string) string

func (*Client) GetHeaderMap added in v0.8.7

func (c *Client) GetHeaderMap() map[string]string

func (*Client) GetPrefix added in v0.8.7

func (c *Client) GetPrefix() string

func (*Client) GetVar added in v0.8.0

func (c *Client) GetVar(ctx context.Context, url string, data ...interface{}) (*gvar.Var, error)

func (*Client) HeadBytes added in v0.8.0

func (c *Client) HeadBytes(ctx context.Context, url string, data ...interface{}) ([]byte, error)

func (*Client) HeadContent added in v0.8.0

func (c *Client) HeadContent(ctx context.Context, url string, data ...interface{}) (string, error)

func (*Client) HeadEventSource added in v0.4.3

func (c *Client) HeadEventSource(ctx context.Context, url string, data ...interface{}) EventSource

func (*Client) HeadVar added in v0.8.0

func (c *Client) HeadVar(ctx context.Context, url string, data ...interface{}) (*gvar.Var, error)

func (*Client) Header added in v0.3.1

func (c *Client) Header(key, value string) *Client

func (*Client) HeaderMap added in v0.8.7

func (c *Client) HeaderMap(m map[string]string) *Client

func (*Client) HeaderRaw added in v0.3.1

func (c *Client) HeaderRaw(headers string) *Client

func (*Client) NoUrlEncode added in v0.3.1

func (c *Client) NoUrlEncode() *Client

func (*Client) OptionsBytes added in v0.8.0

func (c *Client) OptionsBytes(ctx context.Context, url string, data ...interface{}) ([]byte, error)

func (*Client) OptionsContent added in v0.8.0

func (c *Client) OptionsContent(ctx context.Context, url string, data ...interface{}) (string, error)

func (*Client) OptionsEventSource added in v0.4.3

func (c *Client) OptionsEventSource(ctx context.Context, url string, data ...interface{}) EventSource

func (*Client) OptionsVar added in v0.8.0

func (c *Client) OptionsVar(ctx context.Context, url string, data ...interface{}) (*gvar.Var, error)

func (*Client) PatchBytes added in v0.8.0

func (c *Client) PatchBytes(ctx context.Context, url string, data ...interface{}) ([]byte, error)

func (*Client) PatchContent added in v0.8.0

func (c *Client) PatchContent(ctx context.Context, url string, data ...interface{}) (string, error)

func (*Client) PatchEventSource added in v0.4.3

func (c *Client) PatchEventSource(ctx context.Context, url string, data ...interface{}) EventSource

func (*Client) PatchVar added in v0.8.0

func (c *Client) PatchVar(ctx context.Context, url string, data ...interface{}) (*gvar.Var, error)

func (*Client) PostBytes

func (c *Client) PostBytes(ctx context.Context, url string, data ...interface{}) ([]byte, error)

func (*Client) PostContent

func (c *Client) PostContent(ctx context.Context, url string, data ...interface{}) (string, error)

func (*Client) PostEventSource added in v0.4.3

func (c *Client) PostEventSource(ctx context.Context, url string, data ...interface{}) EventSource

func (*Client) PostVar added in v0.8.0

func (c *Client) PostVar(ctx context.Context, url string, data ...interface{}) (*gvar.Var, error)

func (*Client) Prefix added in v0.3.1

func (c *Client) Prefix(prefix string) *Client

func (*Client) Proxy added in v0.3.1

func (c *Client) Proxy(proxyURL string) *Client

func (*Client) PutBytes added in v0.8.0

func (c *Client) PutBytes(ctx context.Context, url string, data ...interface{}) ([]byte, error)

func (*Client) PutContent added in v0.8.0

func (c *Client) PutContent(ctx context.Context, url string, data ...interface{}) (string, error)

func (*Client) PutEventSource added in v0.4.3

func (c *Client) PutEventSource(ctx context.Context, url string, data ...interface{}) EventSource

func (*Client) PutVar added in v0.8.0

func (c *Client) PutVar(ctx context.Context, url string, data ...interface{}) (*gvar.Var, error)

func (*Client) RawContentEventSource added in v0.8.5

func (c *Client) RawContentEventSource(ctx context.Context, content string) EventSource

func (*Client) RawContentRequestBytes added in v0.8.5

func (c *Client) RawContentRequestBytes(ctx context.Context, content string) ([]byte, error)

func (*Client) RawContentRequestContent added in v0.8.5

func (c *Client) RawContentRequestContent(ctx context.Context, content string) (string, error)

func (*Client) RawContentRequestVar added in v0.8.5

func (c *Client) RawContentRequestVar(ctx context.Context, content string) (*gvar.Var, error)

func (*Client) RawFnEventSource added in v0.8.5

func (c *Client) RawFnEventSource(ctx context.Context, rawFn func(context.Context) (string, error)) EventSource

func (*Client) RawFnRequestBytes added in v0.8.5

func (c *Client) RawFnRequestBytes(ctx context.Context, rawFn func(context.Context) (string, error)) ([]byte, error)

func (*Client) RawFnRequestContent added in v0.8.5

func (c *Client) RawFnRequestContent(ctx context.Context, rawFn func(context.Context) (string, error)) (string, error)

func (*Client) RawFnRequestVar added in v0.8.5

func (c *Client) RawFnRequestVar(ctx context.Context, rawFn func(context.Context) (string, error)) (*gvar.Var, error)

func (*Client) RedirectLimit added in v0.3.1

func (c *Client) RedirectLimit(redirectLimit int) *Client

func (*Client) RequestBytes

func (c *Client) RequestBytes(ctx context.Context, method string, url string, data ...interface{}) ([]byte, error)

func (*Client) RequestContent

func (c *Client) RequestContent(ctx context.Context, method string, url string, data ...interface{}) (string, error)

func (*Client) RequestVar added in v0.8.0

func (c *Client) RequestVar(ctx context.Context, method string, url string, data ...interface{}) (*gvar.Var, error)

func (*Client) SetIntLog added in v0.3.2

func (c *Client) SetIntLog(intlog *glog.Logger) *Client

func (*Client) Timeout added in v0.3.1

func (c *Client) Timeout(t time.Duration) *Client

func (*Client) TmplEventSource added in v0.8.4

func (c *Client) TmplEventSource(ctx context.Context, view *gviewx.View,
	key string, params ...gview.Params) EventSource

func (*Client) TmplRequestBytes added in v0.8.4

func (c *Client) TmplRequestBytes(ctx context.Context,
	view *gviewx.View, key string, params ...gview.Params) ([]byte, error)

func (*Client) TmplRequestContent added in v0.8.4

func (c *Client) TmplRequestContent(ctx context.Context, view *gviewx.View,
	key string, params ...gview.Params) (string, error)

func (*Client) TmplRequestVar added in v0.8.4

func (c *Client) TmplRequestVar(ctx context.Context, view *gviewx.View,
	key string, params ...gview.Params) (*gvar.Var, error)

func (*Client) TraceBytes added in v0.8.0

func (c *Client) TraceBytes(ctx context.Context, url string, data ...interface{}) ([]byte, error)

func (*Client) TraceContent added in v0.8.0

func (c *Client) TraceContent(ctx context.Context, url string, data ...interface{}) (string, error)

func (*Client) TraceEventSource added in v0.4.3

func (c *Client) TraceEventSource(ctx context.Context, url string, data ...interface{}) EventSource

func (*Client) TraceVar added in v0.8.0

func (c *Client) TraceVar(ctx context.Context, url string, data ...interface{}) (*gvar.Var, error)

type Event added in v0.4.3

type Event struct {
	Id    string
	Event string
	Data  string
}

type EventSource added in v0.4.3

type EventSource interface {
	Event() <-chan *Event
	Err() error
	Close()
}

type HttpError added in v0.8.1

type HttpError interface {
	Error() string
	StatusCode() int
	StatusText() string
}

Jump to

Keyboard shortcuts

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