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 ¶
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 ¶
DeleteSession deletes an existing Session by making a HTTP DELETE request to {Client.Endpoint}/sessions/{id}.
func (Service) Session ¶
Session retrieves a Session instance by making a HTTP GET request to {Client.Endpoint}/sessions/{id}.
func (Service) UpdateSession ¶
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.