client

package module
v0.0.0-...-7e9b866 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 10 Imported by: 3

README

Client for Gimulator

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	http.Client
	websocket.Dialer
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ch chan Object) (*Client, error)

func (*Client) Delete

func (c *Client) Delete(key Key) error

func (*Client) Find

func (c *Client) Find(key Key) ([]Object, error)

func (*Client) Get

func (c *Client) Get(key Key) (Object, error)

func (*Client) Set

func (c *Client) Set(key Key, val string) error

func (*Client) Watch

func (c *Client) Watch(key Key) error

type Jar

type Jar struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Jar) Cookies

func (jar *Jar) Cookies(u *url.URL) []*http.Cookie

Cookies returns the cookies to send in a request for the given URL. It is up to the implementation to honor the standard cookie use restrictions such as in RFC 6265.

func (*Jar) SetCookies

func (jar *Jar) SetCookies(u *url.URL, cookies []*http.Cookie)

SetCookies handles the receipt of the cookies in a reply for the given URL. It may or may not choose to save the cookies, depending on the jar's policy and implementation.

type Key

type Key struct {
	Type      string
	Namespace string
	Name      string
}

func (Key) Equal

func (k Key) Equal(key Key) bool

func (Key) Match

func (k Key) Match(key Key) bool

func (Key) String

func (k Key) String() string

type Meta

type Meta struct {
	CreationTime time.Time
	Owner        string
	Method       Method
}

func (Meta) String

func (m Meta) String() string

type Method

type Method string
const (
	MethodGet    Method = "get"
	MethodSet    Method = "set"
	MethodFind   Method = "find"
	MethodDelete Method = "delete"
	MethodWatch  Method = "watch"
)

type Object

type Object struct {
	Meta  Meta
	Key   Key
	Value string
}

func (Object) String

func (o Object) String() string

Jump to

Keyboard shortcuts

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