sharesession

package
v0.0.0-...-66b3d1b Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2015 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Q_SELECT_TORRENT     = `SELECT torrent FROM meta`
	Q_SELECT_INFOHASH    = `SELECT infohash FROM meta`
	Q_SELECT_LASTMODTIME = `SELECT lastmodtime FROM meta`
	Q_SELECT_IHMESSAGE   = `SELECT ihmessage FROM meta`
	Q_SELECT_FOLDER      = `SELECT folder FROM meta`
	Q_INSERT_TORRENT     = `UPDATE meta SET torrent=?, infohash=?, lastmodtime=?`
	Q_INSERT_IHMESSAGE   = `UPDATE meta SET ihmessage=?`
)
View Source
var (
	CREATESTRINGS = []string{
		`CREATE TABLE meta(
			torrent string,
			infohash string,
			lastmodtime string,
			ihmessage string,
			folder string,
			wrs string,
			rs string,
			s string
		)`,

		`CREATE TABLE peers(
			hostport string primary key,
			valid_until string
		)`,
	}
)

Functions

This section is empty.

Types

type Session

type Session struct {
	// contains filtered or unexported fields
}

func New

func New(path string) (*Session, error)

func (*Session) GetCurrentIHMessage

func (s *Session) GetCurrentIHMessage() string

func (*Session) GetCurrentInfohash

func (s *Session) GetCurrentInfohash() string

func (*Session) GetCurrentTorrent

func (s *Session) GetCurrentTorrent() string

func (*Session) GetLastModTime

func (s *Session) GetLastModTime() time.Time

func (*Session) GetPeers

func (s *Session) GetPeers() (peers []string)

func (*Session) GetShareId

func (sess *Session) GetShareId() id.Id

func (*Session) GetTarget

func (s *Session) GetTarget() string

func (*Session) SaveIHMessage

func (s *Session) SaveIHMessage(mess []byte) error

func (*Session) SavePeer

func (s *Session) SavePeer(peer string, shouldKeep func(peer string) bool) error

func (*Session) SaveSession

func (s *Session) SaveSession(target string, theid id.Id) error

func (*Session) SaveTorrent

func (s *Session) SaveTorrent(torrent []byte, infohash, lastModTime string) error

Jump to

Keyboard shortcuts

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