message

package
v0.0.0-...-4d7690c Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMessageNotFound = errors.New("Message Not Found")

Predefined error instance so that controller can easily figure out which type of error GetByUUID() returned

View Source
var ErrValidationError = errors.New("Message Text cannot be empty")

Functions

This section is empty.

Types

type Message

type Message struct {
	Id        int       `json:"id" db:"id"`
	Uuid      string    `json:"uuid" db:"uuid"`
	Text      string    `json:"text" db:"text"`
	CreatedOn time.Time `json:"created_on" db:"created_on"`
}

type that represents Message entity

func Create

func Create(text string) (*Message, error)

prepare and insert the message into the database returns error or nil

func GetByUUID

func GetByUUID(uuid string) (*Message, error)

Retrive a message using given uuid param: uuid: string: uuid of the message to retrive returns Message object on success returns error in case of error

Jump to

Keyboard shortcuts

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