hourglass

package module
v0.0.0-...-246dad0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const CITT = 0xFFFF

Variables

View Source
var (
	ErrNotFound        = errors.New("not found")
	ErrUnauthenticated = errors.New("invalid credentials")
	ErrNotSupported    = errors.New("not supported")
	ErrInvalid         = errors.New("invalid")
)

Functions

func DeleteEvent

func DeleteEvent(db *sql.DB, e *Event) error

func DeleteFile

func DeleteFile(db *sql.DB, f *File) error

func DeleteJournal

func DeleteJournal(db *sql.DB, j *Journal) error

func DeleteSlot

func DeleteSlot(db *sql.DB, s *Slot) error

func DeleteTodo

func DeleteTodo(db *sql.DB, t *Todo) error

func ImportEvents

func ImportEvents(db *sql.DB, s string, es []*Event) error

func ListSources

func ListSources(db *sql.DB) ([]string, error)

func NewCategory

func NewCategory(db *sql.DB, c *Category) error

func NewEvent

func NewEvent(db *sql.DB, e *Event) error

func NewFile

func NewFile(db *sql.DB, f *File) error

func NewJournal

func NewJournal(db *sql.DB, j *Journal) error

func NewSlot

func NewSlot(db *sql.DB, s *Slot) error

func NewTodo

func NewTodo(db *sql.DB, t *Todo) error

func RegisterUser

func RegisterUser(db *sql.DB, u *User, passwd string) error

func UpdateCategory

func UpdateCategory(db *sql.DB, c *Category) error

func UpdateEvent

func UpdateEvent(db *sql.DB, e *Event) error

func UpdateFile

func UpdateFile(db *sql.DB, f *File) error

func UpdateJournal

func UpdateJournal(db *sql.DB, j *Journal) error

func UpdatePasswd

func UpdatePasswd(db *sql.DB, u *User, old, passwd string) error

func UpdateTodo

func UpdateTodo(db *sql.DB, t *Todo) error

Types

type Category

type Category struct {
	Id      int       `json:"uid"`
	Name    string    `json:"name"`
	User    string    `json:"user"`
	Lastmod time.Time `json:"lastmod"`
}

func ListCategories

func ListCategories(db *sql.DB) ([]*Category, error)

func ViewCategory

func ViewCategory(db *sql.DB, id int) (*Category, error)

type Error

type Error struct {
	Severity string `json:"severity"`
	Source   string `json:"source"`
	Message  string `json:"message"`
}

func (Error) Error

func (e Error) Error() string

type Event

type Event struct {
	Id          int                    `json:"uid"`
	Summary     string                 `json:"summary"`
	Description string                 `json:"description"`
	Source      string                 `json:"source"`
	State       string                 `json:"status"`
	Meta        map[string]interface{} `json:"metadata"`
	Starts      time.Time              `json:"dtstart"`
	Ends        time.Time              `json:"dtend"`
	ExStarts    time.Time              `json:"rtstart"`
	ExEnds      time.Time              `json:"rtend"`
	User        string                 `json:"user"`
	Attendees   []string               `json:"attendees"`
	Categories  []string               `json:"categories"`
	Version     int                    `json:"version"`
	Lastmod     time.Time              `json:"lastmod"`
	Attachment  *File                  `json:"attachment"`
	Events      []*Event               `json:"events,omitempty"`

	Versions []*Event `json:"history,omitempty"`
}

func ListEvents

func ListEvents(db *sql.DB, f, t time.Time, cs, vs []string) ([]*Event, error)

func ViewEvent

func ViewEvent(db *sql.DB, id int) (*Event, error)

type Exporter

type Exporter interface {
	Export(io.Writer, string) error
}

type File

type File struct {
	Id         int                    `json:"uid"`
	Name       string                 `json:"name"`
	Summary    string                 `json:"summary"`
	Content    []byte                 `json:"raw,omitempty"`
	Categories []string               `json:"categories"`
	Meta       map[string]interface{} `json:"metadata"`
	Version    int                    `json:"version"`
	Length     int                    `json:"length"`
	Sum        string                 `json:"sum"`
	Cyclic     uint16                 `json:"crc"`

	Dummy       bool `json:"dummy"`
	Superseeded bool `json:"superseeded"`
	Original    bool `json:"original"`

	User    string    `json:"user"`
	Lastmod time.Time `json:"lastmod"`

	Slot     string `json:"slot"`
	Location string `json:"location"`

	Versions []*File `json:"history,omitempty"`
	Parents  []*File `json:"parents,omitempty"`
}

func ListFiles

func ListFiles(db *sql.DB, which string, cs []string) ([]*File, error)

func ViewFile

func ViewFile(db *sql.DB, id int, raw, parent bool) (*File, error)

type Journal

type Journal struct {
	Id         int                    `json:"uid"`
	Day        time.Time              `json:"dtstamp"`
	Summary    string                 `json:"summary"`
	User       string                 `json:"user"`
	State      string                 `json:"status"`
	Lastmod    time.Time              `json:"lastmod"`
	Meta       map[string]interface{} `json:"metadata"`
	Categories []string               `json:"categories"`

	Versions []*Journal `json:"history,omitempty"`
}

func ListJournals

func ListJournals(db *sql.DB, f, t time.Time, cs []string) ([]*Journal, error)

func ViewJournal

func ViewJournal(db *sql.DB, id int) (*Journal, error)

type Scanner

type Scanner interface {
	Scan(...interface{}) error
}

type Slot

type Slot struct {
	Id       int       `json:"uid"`
	Name     string    `json:"name"`
	Category string    `json:"category"`
	User     string    `json:"user"`
	Lastmod  time.Time `json:"lastmod"`

	File  string `json:"file"`
	State string `json:"status"`

	Uplinks []*Uplink `json:"uplinks,omitempty"`
}

func ListSlots

func ListSlots(db *sql.DB, cs []string) ([]*Slot, error)

func ViewSlot

func ViewSlot(db *sql.DB, id int) (*Slot, error)

type Todo

type Todo struct {
	Id          int                    `json:"uid"`
	Summary     string                 `json:"summary"`
	Description string                 `json:"description"`
	State       string                 `json:"status"`
	Priority    string                 `json:"priority"`
	Meta        map[string]interface{} `json:"metadata"`
	Version     int                    `json:"version"`
	Due         time.Time              `json:"due"`
	Starts      time.Time              `json:"dtstart"`
	Ends        time.Time              `json:"dtend"`
	Lastmod     time.Time              `json:"lastmod"`
	User        string                 `json:"user"`
	Categories  []string               `json:"categories"`
	Assignees   []string               `json:"assignees"`

	Todos    []*Todo `json:"todos,omitempty"`
	Versions []*Todo `json:"history,omitempty"`
}

func ListTodos

func ListTodos(db *sql.DB, cs []string) ([]*Todo, error)

func ViewTodo

func ViewTodo(db *sql.DB, id int) (*Todo, error)

type Transfer

type Transfer struct {
	Id       int       `json:"uid"`
	Status   string    `json:"status"`
	User     string    `json:"user"`
	Location string    `json:"location"`
	Lastmod  time.Time `json:"lastmod"`

	*Event `json:"event"`
	*File  `json:"file"`
	*Slot  `json:"slot"`
}

func ListTransfers

func ListTransfers(db *sql.DB, fd, td time.Time, cs, ts []string) ([]*Transfer, error)

func NewTransfer

func NewTransfer(db *sql.DB, i, e int, u, d string) (*Transfer, error)

func UpdateTransfer

func UpdateTransfer(db *sql.DB, id int, s, u string) (*Transfer, error)

func ViewTransfer

func ViewTransfer(db *sql.DB, id int) (*Transfer, error)
type Uplink struct {
	Id      int       `json:"uid"`
	Name    string    `json:"dropbox"`
	Status  string    `json:"status"`
	User    string    `json:"user"`
	Lastmod time.Time `json:"lastmod"`

	*Slot  `json:"slot"`
	*Event `json:"event"`
	*File  `json:"file"`
}
func ListDownlinks(db *sql.DB, fd, td time.Time, cs, ts []string) ([]*Uplink, error)
func ListUplinks(db *sql.DB, fd, td time.Time, cs, ts []string) ([]*Uplink, error)
func NewDownlink(db *sql.DB, e, s, f int, u string) (*Uplink, error)
func NewUplink(db *sql.DB, s, e, f int, u string) (*Uplink, error)
func UpdateDownlink(db *sql.DB, id int, s, u string) (*Uplink, error)
func UpdateUplink(db *sql.DB, id int, s, u string) (*Uplink, error)
func ViewDownlink(db *sql.DB, id int) (*Uplink, error)
func ViewUplink(db *sql.DB, id int) (*Uplink, error)

type User

type User struct {
	Id        int      `json:"id"`
	First     string   `json:"firstname"`
	Last      string   `json:"lastname"`
	Initial   string   `json:"initial"`
	Email     string   `json:"email"`
	Internal  bool     `json:"internal"`
	Positions []string `json:"positions"`

	Settings map[string]interface{} `json:"settings"`

	Events []*Event `json:"events"`
	Todos  []*Todo  `json:"todos"`
}

func Authenticate

func Authenticate(db *sql.DB, i, p string) (*User, error)

func ListUsers

func ListUsers(db *sql.DB) ([]*User, error)

func UpdateUser

func UpdateUser(db *sql.DB, u *User) (*User, error)

func ViewUser

func ViewUser(db *sql.DB, id int) (*User, error)

Directories

Path Synopsis
cmd
hg command

Jump to

Keyboard shortcuts

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