gclientx

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 16 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 {
	Client *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(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(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(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(method string, url string, data ...interface{}) EventSource

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) GetEventSource added in v0.4.3

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

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(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(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(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(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(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(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(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(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(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(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