api

package
v0.0.0-...-1cbc9ae Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthResponse

type AuthResponse struct {
	Token string `json:"token"`
}

AuthResponse response for authentication

type JWTClaims

type JWTClaims struct {
	User *int64 `json:"user"`
	jwt.StandardClaims
}

JWTClaims custom claims with user id

type Server

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

Server is the API main server struct

func NewServer

func NewServer(storage db.Storage, tgToken string, jwtSecret string) *Server

NewServer creates a new server

func (*Server) Run

func (s *Server) Run(port int) error

Run starts the server

type UserDictionaryItem

type UserDictionaryItem struct {
	Word     db.DictionaryItem
	UserItem db.UserDictionaryItem
}

UserDictionaryItem represents user dictionary item in API response

Jump to

Keyboard shortcuts

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