api

package
v0.0.0-...-6719265 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoginAuth

func LoginAuth(username, password string) smtp.Auth

func RUN

func RUN()

func SendMail

func SendMail(to string, message []byte) error

func WriteJSON

func WriteJSON(w http.ResponseWriter, status int, data any) error

Types

type APIServer

type APIServer struct {
	ListenAddress string
	DB            db.Database
}

func (*APIServer) New

func (s *APIServer) New()

func (*APIServer) RUN

func (s *APIServer) RUN()

type Post

type Post struct {
	Author    string // username of the author
	Content   string
	CreatedAt string //TODO: make it a date type compatable with the one in the database
}

type User

type User struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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