httpSession

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2017 License: BSD-3-Clause Imports: 4 Imported by: 1

Documentation

Overview

Package httpSession provides a HTTP client to an external session service that can respond to HTTP requests defined here.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSessionNotFound = errorRegistry.MustAddMessageError(1000, "Session Not Found")
)

Errors that are returned from the HTTP server.

Functions

This section is empty.

Types

type Client added in v0.5.2

type Client struct {
	*apiClient.Client
}

Client implements gopherpit.com/gopherpit/services/session.Service interface.

func NewClient added in v0.5.2

func NewClient(c *apiClient.Client) *Client

NewClient creates a new Client.

func (Client) CreateSession added in v0.5.2

func (c Client) CreateSession(o *session.Options) (ses *session.Session, err error)

CreateSession creates a new Session with Options by making a HTTP POST request to {Client.Endpoint}/sessions. Post body is a JSON-encoded session.Options instance.

func (Client) DeleteSession added in v0.5.2

func (c Client) DeleteSession(id string) error

DeleteSession deletes an existing Session by making a HTTP DELETE request to {Client.Endpoint}/sessions/{id}.

func (Client) Session added in v0.5.2

func (c Client) Session(id string) (ses *session.Session, err error)

Session retrieves a Session instance by making a HTTP GET request to {Client.Endpoint}/sessions/{id}.

func (Client) UpdateSession added in v0.5.2

func (c Client) UpdateSession(id string, o *session.Options) (ses *session.Session, err error)

UpdateSession changes the data of an existing Session by making a HTTP POST request to {Client.Endpoint}/sessions/{id}. Post body is a JSON-encoded session.Options instance.

Jump to

Keyboard shortcuts

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