Interface

package
v0.0.0-...-39147ba Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2016 License: BSD-2-Clause Imports: 7 Imported by: 7

Documentation

Index

Constants

View Source
const (
	//VIEW_TYPE_NORMAL:
	//	some thing like a news, and some pictures inset the content
	VIEW_TYPE_NORMAL = 1

	//VIEW_TYPE_PICTURES:
	//	some thing like tweet,
	//	have series of picture. but short, can avoiding body content.
	VIEW_TYPE_PICTURES = 2
)

Variables

View Source
var (
	StmtInsert           *sql.Stmt
	StmtInsertRef        *sql.Stmt
	StmtSelectMidFromURL *sql.Stmt

	ErrorNotInvaildURL = errors.New("url is not invaild")
)

Functions

func Init

func Init()

func MsgsInsertIntoSQL

func MsgsInsertIntoSQL(msgs []*Message) error

Types

type Author

type Author struct {
	Name      string `json:"name"`
	Uid       string `json:"uid"`
	AvatarUrl string `json:"covert_source"` //can empty
}

Author:

Name: name to display
Uid: uuid of this author, recommend using PLUGIN-NAME{_TOPIC-NAME}_AUTHOR-NAME
AvatarUrl: url of Author's avatar

func (*Author) InsertIntoSQL

func (t *Author) InsertIntoSQL() error

InsertIntoSQL:

Insert this author to sql database,
throw error if the author is null, or some error sql caused

type Image

type Image struct {
	Ref   string `json:"ref"` //not set if not have
	Desc  string `json:"desc"`
	Pixes string `json:"pixes"`
	URL   string `json:"url"`
}

Image:

func (*Image) InsertIntoQueue

func (img *Image) InsertIntoQueue() (string, error)

func (*Image) InsertIntoSQL

func (img *Image) InsertIntoSQL(mid int64) (sql.Result, error)

type Message

type Message struct {
	//ID          string   `json:"id"`
	SnapTime int64    `json:"snaptime"` //*   //lastmodify
	PubTime  int64    `json:"pubtime"`  //*
	Source   string   `json:"source"`   //*
	Body     string   `json:"body"`     //*
	Title    string   `json:"title"`    //*
	Subtitle string   `json:"subtitle"` //*
	CoverImg string   `json:"coverimg"` //if not have this field shoud be "" //*
	Images   []*Image `json:"images"`
	//ReplyNumber int64    `json:"replynumber"`
	//Replys      []Reply  `json:"replys"`
	ViewType int    `json:"viewtype"` //*
	Topic    string `json:"topic"`    //*
	//Version     string   `json:"version"`
	Tag    string  `json:"tag"`    //*
	Author *Author `json:"author"` //*

}

func (*Message) InsertIntoSQL

func (m *Message) InsertIntoSQL() (sql.Result, error)

type Reply

type Reply []*ReplyFloor

Reply:

not using now

type ReplyFloor

type ReplyFloor struct {
	Floor   int    `json:"floor"`
	Time    int64  `json:"time"`
	Name    string `json:"name"`
	Content string `json:"content"`
	Digg    int    `jsong:"digg"`
}

ReplyFloor:

not using now

Jump to

Keyboard shortcuts

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