client

package
v0.0.0-...-840a1b4 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// PostUser creates a new user account.
	PostUser(*model.User) (*model.User, error)

	// GetUser gets an user by the user identifier.
	GetUser(string) (*model.User, error)

	// PutUser updates an user account information.
	PutUser(int, *model.User) (*model.User, error)

	// DeleteUser deletes the user by the user identifier.
	DeleteUser(int) error

	// PostToken generates the authentication token
	// if the password was matched with the specified account.
	PostToken(*model.User) (*model.Token, error)
}

Client is used to communicate with the service.

func NewClient

func NewClient(uri string) Client

NewClient returns a client at the specified url.

func NewClientToken

func NewClientToken(uri, token string) Client

NewClientToken returns a client at the specified url that authenticates all outbound requests with the given token.

Jump to

Keyboard shortcuts

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