blog_engine

module
v0.0.0-...-9305a47 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: GPL-3.0

README

API's

Login/registration user
Endpoint Method Task Body/Query Authorization Implemented
/api/v1/auth/register POST Register user username, displayedName, password, invite [x]
/api/v1/auth/login POST Login username, password [x]
/api/v1/auth/user GET Get information about current user + [x]
/api/v1/auth/logout POST Logout active session + [x]
Invites
Endpoint Method Task Body/Query Authorization Implemented
/api/v1/invites/generate GET Generate invite token + [x]
/api/v1/invites/revoke DELETE Revoke generated invite token + [x]
Post
Endpoint Method Task Body/Query Authorization Implemented
/api/v1/posts POST Create post title, short, body, tags, isPublised + [x]
/api/v1/posts GET Get list of posts for authorized user limit, page, query + [x]
/api/v1/posts/:id PUT Edit post title, short, body, tags, isPublished + [x]
/api/v1/posts/:id GET Get publised post by id [x]
/api/v1/posts/feed GET Get list of all posts from all users (main page) page, limit, query [x]
User
Endpoint Method Task Body/Query Authorization Implemented
/api/v1/user/password PUT Update password oldPassword, newPassword + [x]
/api/v1/user/profile PUT Update user info displayedName, email + [x]
/api/v1/user/:id GET Get information about user [x]
Endpoint Method Task Body/Query Implemented
/api/v1/users/:id PATCH Update user info password, displayed_name, email, image
Common RO user api's
Endpoint Method Task Body/Query Implemented
/api/v1/posts/:id GET Get full post
/api/v1/users GET Get list of all users with short information query
/api/v1/users/:id GET Get full information about selected user
/api/v1/users/:id/posts GET Get list of all posts selected user page, limit
/api/v1/posts/:id/comments GET Get list of all comments selected post page, limit, order
/api/v1/posts/:id/comments POST Add comment to selected post text
/api/v1/posts/:id/comments/:id PATCH Edit selected comment text

Data types

Post:

struct Post {
	ID int32
	UserID int32
	Title string
	Short string
	Body string
	Tags []string
	IsPublished bool
}

Comment:

struct Comment {
	ID int32
	UserID int32
	PostID int32
	Text string
}

User:

struct User {
	ID int32
	Username string
	DisplayedName string
	Email string
	InvitedByUser int
}

Invite:

struct InviteUser {
	ID int32
	UserID int32
	InviteHash string
	IsActivated bool
}

Session:

struct Session {
	ID int
	UserID int
	TokenHash string
}

Directories

Path Synopsis
cmd
blog_engine
Package main Blog Engine.
Package main Blog Engine.
internal
db
dto
pkg
proto/server
Package server is a reverse proxy.
Package server is a reverse proxy.

Jump to

Keyboard shortcuts

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