api

package
v0.0.0-...-f97eb1b Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MiscTopic string = "Misc"
)

Variables

View Source
var (
	InternalError    = gin.H{"error": "internal error"}
	InvalidId        = gin.H{"error": "invalid notebook id"}
	NotebookNotFound = gin.H{"error": "notebook not found"}
	NotImplemented   = gin.H{"error": "not implemented"}
	NotebookDeleted  = gin.H{"message": "notebook deleted"}
	Forbidden        = gin.H{"message": "forbidden"}
)
View Source
var (
	UserWithEmailAlreadyExists = gin.H{"error": "there is a username already registered with this email"}
	UserWithEmailDoesNotExist  = gin.H{"error": "no user is registered with that email"}
	UserNotAuthorized          = gin.H{"error": "user not authorized"}
)

Functions

This section is empty.

Types

type NotebooksHandler

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

func NewNotebooksHandler

func NewNotebooksHandler(storage db.Storage, ctx context.Context) *NotebooksHandler

func (*NotebooksHandler) AddNewNotebookHandler

func (handler *NotebooksHandler) AddNewNotebookHandler(c *gin.Context)

func (*NotebooksHandler) DeleteNotebookHandler

func (handler *NotebooksHandler) DeleteNotebookHandler(c *gin.Context)

func (*NotebooksHandler) GetNotebookTitlesByTopic

func (handler *NotebooksHandler) GetNotebookTitlesByTopic(c *gin.Context)

func (*NotebooksHandler) ListNotebookByIdHandler

func (handler *NotebooksHandler) ListNotebookByIdHandler(c *gin.Context)

func (*NotebooksHandler) ListNotebooksHandler

func (handler *NotebooksHandler) ListNotebooksHandler(c *gin.Context)

func (*NotebooksHandler) ListTopicsHandler

func (handler *NotebooksHandler) ListTopicsHandler(c *gin.Context)

func (*NotebooksHandler) SearchNotebookHandler

func (handler *NotebooksHandler) SearchNotebookHandler(c *gin.Context)

func (*NotebooksHandler) UpdateNotebookHandler

func (handler *NotebooksHandler) UpdateNotebookHandler(c *gin.Context)

type Server

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

func NewServer

func NewServer(config utils.Config, storage db.Storage) (*Server, error)

func (*Server) Start

func (server *Server) Start(address string) error

Start runs the HTTP server on a specific address.

type TokenHandler

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

func NewTokenHandler

func NewTokenHandler(
	config utils.Config,
	tokenMaker token.TokenMaker,
	storage db.Storage,
	ctx context.Context) *TokenHandler

func (*TokenHandler) RenewAccessToken

func (handler *TokenHandler) RenewAccessToken(c *gin.Context)

type UserHandler

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

func NewUserHander

func NewUserHander(config utils.Config, tokenMaker token.TokenMaker, storage db.Storage, ctx context.Context) *UserHandler

func (*UserHandler) AddNewUserHandler

func (handler *UserHandler) AddNewUserHandler(c *gin.Context)

func (*UserHandler) LoginUser

func (handler *UserHandler) LoginUser(c *gin.Context)

Jump to

Keyboard shortcuts

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