session

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: LGPL-2.1 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSessionNotFound = server.NewHTTPError(http.StatusBadRequest, "SESSION_NOTFOUND", "Session not found")
)

Custom errors

Functions

func NewHTTP

func NewHTTP(svc Service, eg *echo.Group)

NewHTTP attaches handlers to Echo routers under given group

Types

type HTTP

type HTTP struct {
	contextutil.Context
	// contains filtered or unexported fields
}

HTTP represents session http service

type ListSessionReq

type ListSessionReq struct {
	requestutil.ListQueryRequest
}

ListSessionReq contains request data to get list of sessions swagger:parameters sessionsList

type ListSessionsResp

type ListSessionsResp struct {
	Data       []*types.Session `json:"data"`
	TotalCount int64            `json:"total_count"`
}

ListSessionsResp contains list of paginated users and total numbers after filtered swagger:model

type Service

Service represents session application interface

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session represents session application service

func New

func New(repo *repo.Service, rbacSvc rbac.Intf) *Session

New creates new session application service

func (*Session) Delete

func (s *Session) Delete(c contextutil.Context, id string) error

Delete deletes session by id

func (*Session) List

List returns the list of users

func (*Session) Read

func (s *Session) Read(c contextutil.Context, id string) (*types.Session, error)

Read returns single session by id

func (*Session) Update

func (s *Session) Update(c contextutil.Context, id string, data UpdateSessionReq) (*types.Session, error)

Update updates session information

type UpdateSessionReq

type UpdateSessionReq struct {
	IsBlocked *bool `json:"is_blocked,omitempty"`
}

UpdateSessionReq contains request data to update existing session swagger:model

Jump to

Keyboard shortcuts

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