cmd

package
v0.0.0-...-3b0c892 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const BASE_URL = "http://localhost:8000"

Variables

View Source
var WaitValue time.Duration = 3

Functions

func AuthenticationMiddleware

func AuthenticationMiddleware(next http.Handler) http.Handler

func DeleteSession

func DeleteSession(w http.ResponseWriter)

func Execute

func Execute()

func GetItem

func GetItem[T Task | Folder | User](t *testing.T, client *http.Client, path string) (T, error)

func GetItems

func GetItems[T any](t *testing.T, client *http.Client, path string) ([]T, error)

func PostItem

func PostItem[T Task | Folder | User](t *testing.T, client *http.Client, path string, item T) (T, error)

func RunSeed

func RunSeed()

func UpdateToken

func UpdateToken(w http.ResponseWriter, r *http.Request) error

Types

type Folder

type Folder struct {
	ID   int64  `json:"id,omitempty"`
	Name string `json:"name"`
}

type Payload

type Payload struct {
	UserID    int64
	ExpiresAt time.Time
}

type Task

type Task struct {
	ID          int64     `json:"id,omitempty"`
	Title       string    `json:"title"`
	Description string    `json:"description"`
	Completed   bool      `json:"completed"`
	DueDate     time.Time `json:"due_date"`
	FolderId    int64     `json:"folder_id"`
}

type Token

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

type User

type User struct {
	ID       int64  `json:"id,omitempty"`
	Username string `json:"username"`
	Password string `json:"password,omitempty"`
}

Jump to

Keyboard shortcuts

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