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