models

package
v0.0.0-...-d3c2a3e Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAuth

func CheckAuth(username, password string) bool

func CheckMessageAuth

func CheckMessageAuth(username, messageIdStr string) (code int, err error, msg string)

func DeleteMessage

func DeleteMessage(messageIdStr string) (code int, err error, msg string)

func DeleteUser

func DeleteUser(username string) (code int, err error, msg string)

func Login

func Login(username string, password string) (code int, err error, msg string)

func ModifyUser

func ModifyUser(username, newUsername, newPassword string) (code int, err error, msg string)

func Register

func Register(username, password string) (code int, err error, msg string)

func Setup

func Setup()

Types

type Auth

type Auth struct {
	ID       int    `json:"id"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type Message

type Message struct {
	MessageId  int    `json:"message_id"`
	Username   string `json:"username"`
	Title      string `json:"title"`
	Content    string `json:"content"`
	ImageUrl   string `json:"image_url"`
	CreatedOn  int    `json:"created_on"`
	ModifiedOn int    `json:"modified_on"`
}

func AddMessage

func AddMessage(username, title, content, imageUrl string) (message Message, code int, err error, msg string)

func GetMessageById

func GetMessageById(messageIdStr string) (message Message, code int, err error, msg string)

func GetMessages

func GetMessages(pageStr, perPageStr string) (messages []Message, code int, err error, msg string)

func ModifyMessage

func ModifyMessage(messageIdStr, title, content, imageUrl string) (message Message, code int, err error, msg string)

type User

type User struct {
	Id       int    `json:"id"`
	Username string `json:"username"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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