sessions_api

package
v0.0.0-...-f348597 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionsAPI

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

func NewSessionsAPI

func NewSessionsAPI(
	ur interfaces.UsersRepo,
	sr interfaces.SessionsRepo,
	logger *slog.Logger) SessionsAPI

func (*SessionsAPI) API

func (sa *SessionsAPI) API(ctx context.Context, r *chi.Mux)

func (*SessionsAPI) GetAllSessions

func (sa *SessionsAPI) GetAllSessions(ctx context.Context,
	w http.ResponseWriter, r *http.Request, usrTkn string) (err error)

TODO: rewrite using domain layer

func (*SessionsAPI) GetSession

func (sa *SessionsAPI) GetSession(
	ctx context.Context,
	w http.ResponseWriter, r *http.Request)

Handling request to /sessions/{tknOrID}

func (*SessionsAPI) KillSession

func (sa *SessionsAPI) KillSession(ctx context.Context,
	w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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