post

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2019 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(p Post)

Add guarda un post nuevo.

func Del

func Del(id int)

Del borra un post.

func Monitor

func Monitor() chan request

Monitor lanza la goroutine que maneja los posts.

func NewId

func NewId() int

NewId genera un ID único para un post.

func Set

func Set(p Post)

Set guarda un post existente.

Types

type Post

type Post struct {
	Id     int
	UserId int
	Title  string
	Body   string
}

Post es una entrada de contenido.

func Get

func Get(id int) (Post, bool)

Get busca un post por ID. El bool es falso si no lo encontramos.

func List

func List() []Post

List devuelve un slice de todos los posts.

Jump to

Keyboard shortcuts

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