db

package
v0.0.0-...-958806c Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPosts

func AddPosts(posts *ShPosts) error

func AddPublishersIfNotExist

func AddPublishersIfNotExist(names *[]string) error

func AddPublishersReplyPosts

func AddPublishersReplyPosts(posts *ShPubReplyPosts) error

todo: Check if reply post was reply to acgsh post in DB.

func Close

func Close()

func DeletePublishers

func DeletePublishers(names *[]string) error

func GetPosts

func GetPosts(idx, n uint) ([]byte, error)

func GetPublishers

func GetPublishers() (map[string]SyncData, error)

func GetPublishersReplyPosts

func GetPublishersReplyPosts(name, k string) ([]byte, error)

func Init

func Init()

func UpdatePublishers

func UpdatePublishers(publishers *map[string]SyncData) error

Types

type ShPost

type ShPost struct {
	//SigUserpost string `json:"sig_userpost"`
	Msg   string `json:"msg"`
	N     string `json:"n"`
	K     int64  `json:"k"`
	Lastk int64  `json:"lastk"`

	Time     uint64 `json:"time"`
	Category string `json:"category"`
	Title    string `json:"title"`
	Magnet   string `json:"magnet"`
	Size     uint64 `json:"size"`
	Team     string `json:"team"`
}

type ShPosts

type ShPosts []ShPost

type ShPubReplyPost

type ShPubReplyPost struct {
	//SigUserpost string `json:"sig_userpost"`
	Msg   string `json:"msg"`
	K     int64  `json:"k"`
	Lastk int64  `json:"lastk"`
	N     string `json:"n"`
	//Height int64  `json:"height"`
	Time uint64 `json:"time"`
}

type ShPubReplyPosts

type ShPubReplyPosts []ShPubReplyPost

type SyncData

type SyncData struct {
	Max    int64 `json:"max"`
	Latest int64 `json:"latest"`
	Since  int64 `json:"since"`
}

Jump to

Keyboard shortcuts

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