townsita

package module
v0.0.0-...-f2a5911 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2015 License: MIT Imports: 8 Imported by: 0

README

Main Townsita application Build Status

To get the code use:

go get github.com/Townsita/townista

Documentation

Index

Constants

View Source
const (
	MessageDraft = iota
	MessagePublished
	MessageDisabled
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct{}

func NewConfig

func NewConfig() *Config

func (*Config) Load

func (c *Config) Load(args []string) error

type DataAdapter

type DataAdapter interface {
	Init()
	MustGetMessageTypes() []*MessageType
	MustGetMessageSubTypes(id string) []*MessageType
	GetMessageTypeById(id string) *MessageType
	SaveMessage(message *Message, user *User) (string, error)
	GetMessageById(id string) (*Message, error)
	LoginUser(user *User) (string, error)
	RegisterUser(user *User) (string, error)
	LoadUserByID(userID string) (*User, error)
	GetOwnMessages(userID string, limit, offset int) []*Message
	GetReceivedMessages(userID string, limit, offset int) []*Message
}

type HTTPError

type HTTPError struct {
	Err     error
	Message string
	Code    int
}

func (HTTPError) Error

func (e HTTPError) Error() string

type Message

type Message struct {
	ID     string
	UserID string
	TypeID string

	Readers    int // Designated readers
	Completed  int // Number of times seen
	TargetHash string
	Latitude   float64
	Longitude  float64
	Radius     int

	Headline string
	Body     string
	Photo    string

	Status    int
	CreatedAd time.Time
	UpdatedAd time.Time
}

type MessageType

type MessageType struct {
	ID    string
	Title string
}
type PathLink struct {
	URL   string
	Label string
}

type Session

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

func NewSession

func NewSession(c *Config, r *http.Request) *Session

func (*Session) AddPath

func (s *Session) AddPath(url, label string)

func (*Session) Logged

func (s *Session) Logged() bool

func (*Session) Set

func (s *Session) Set(name string, value interface{})

type TemplateData

type TemplateData map[string]interface{}

func NewTemplateData

func NewTemplateData(c *Config) TemplateData

func (TemplateData) Set

func (td TemplateData) Set(name string, value interface{})

type Townsita

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

func New

func New(c *Config, da DataAdapter) *Townsita

func (*Townsita) GetHTTPHandler

func (t *Townsita) GetHTTPHandler() http.Handler

type User

type User struct {
	ID string
}

func NewUser

func NewUser() *User

type ValidationErrors

type ValidationErrors []string

Jump to

Keyboard shortcuts

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