httpSession

package
v0.3.2 Latest Latest
Warning

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

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

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// Client provides HTTP request making functionality.
	Client *apiClient.Client
}

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

func NewService added in v0.3.1

func NewService(c *apiClient.Client) *Service

NewService creates a new Service and injects session.ErrorRegistry in the API Client.

func (Service) CreateSession

func (s Service) 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 (Service) DeleteSession

func (s Service) DeleteSession(id string) error

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

func (Service) Session

func (s Service) 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 (Service) UpdateSession

func (s Service) 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