elysium

package
v0.0.0-...-7404638 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2016 License: MIT Imports: 22 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DATALOC = "s3://"
)
View Source
const (
	PW_SALT_LENGTH = 16
)
View Source
const (
	RESULTS_PER_PAGE = 25
)
View Source
const (
	TOPICS_PER_PAGE = 10
)

Variables

View Source
var Templates = template.Must(template.ParseGlob("templates/*.html"))

Functions

func API_Forum

func API_Forum()

func API_Page

func API_Page()

func API_Topic

func API_Topic()

func API_User

func API_User()

func API_v1_ForumsHandler

func API_v1_ForumsHandler(w http.ResponseWriter, r *http.Request)

func API_v1_PostsHandler

func API_v1_PostsHandler(w http.ResponseWriter, r *http.Request)

func API_v1_TopicsHandler

func API_v1_TopicsHandler(w http.ResponseWriter, r *http.Request)

func API_v1_UsersHandler

func API_v1_UsersHandler(w http.ResponseWriter, r *http.Request)

func CreateSession

func CreateSession() string

func Elysium

func Elysium()

func Foo

func Foo()

func ForumHandler

func ForumHandler(w http.ResponseWriter, r *http.Request)

func HomeHandler

func HomeHandler(w http.ResponseWriter, r *http.Request)

func ImportSample

func ImportSample()

func Init

func Init(filename string)

func LoginHandler

func LoginHandler(w http.ResponseWriter, r *http.Request)

func LoginProcess

func LoginProcess(w http.ResponseWriter, r *http.Request)

func Paginate

func Paginate()

func Ping

func Ping()

func PostHandler

func PostHandler(w http.ResponseWriter, r *http.Request)

func RegisterHandler

func RegisterHandler(w http.ResponseWriter, r *http.Request)

func RegisterProcess

func RegisterProcess(w http.ResponseWriter, r *http.Request)

func SaveSession

func SaveSession(sess string, u User)

func Serve

func Serve()

func ThreadHandler

func ThreadHandler(w http.ResponseWriter, r *http.Request)

func UserHandler

func UserHandler(w http.ResponseWriter, r *http.Request)

func UsersHandler

func UsersHandler(w http.ResponseWriter, r *http.Request)

func Whoa

func Whoa()

Types

type Cache

type Cache struct {
}

func (Cache) Check

func (c Cache) Check() bool

func (Cache) Expire

func (c Cache) Expire()

func (Cache) Set

func (c Cache) Set()

type Config

type Config struct {
	Name     string         `json:"name"`
	File     string         `json:"filename"`
	Database ConfigDatabase `json:"database"`
	Dev      ConfigDev      `json:"dev"`
	Stage    ConfigStage    `json:"stage"`
	Prod     ConfigProd     `json:"production"`
	AWS      ConfigAWS      `json:"aws"`
}
var (
	Configuration Config
	DB            *sql.DB
)

type ConfigAWS

type ConfigAWS struct {
	From string `json:"from"`
	Host string `json:"host"`
	User string `json:"user"`
	Pass string `json:"pass"`
}

type ConfigDatabase

type ConfigDatabase struct {
	Type     string `json:"type"`
	Host     string `json:"host"`
	Port     string `json:"port"`
	User     string `json:"user"`
	Pass     string `json:"pass"`
	Database string `json:"database"`
}

type ConfigDev

type ConfigDev struct {
	ConfigEnvironment string `json:"env"`
}

type ConfigEnvironment

type ConfigEnvironment struct {
	Port string `json:"port"`
}

type ConfigProd

type ConfigProd struct {
	ConfigEnvironment string `json:"env"`
}

type ConfigStage

type ConfigStage struct {
	ConfigEnvironment string `json:"env"`
}

type Forum

type Forum struct {
	ID           int    `json:"forum_id"`
	Guid         string `json:"forum_guid"`
	Name         string `json:"forum_name"`
	Organization int    `json:"organization_id"`
	Publication  int    `json:"publication_id"`
	CurrentPage  int
	Topics       []Topic
	PageCount    int
	Pages        []int
}

func GetForum

func GetForum(guid string, page int64) Forum

func (Forum) GetTopics

func (f Forum) GetTopics(page int64) ([]Topic, int)

type Organization

type Organization struct {
	ID   int    `json:"organization_id"`
	Guid string `json:"organization_guid"`
	Name string `json:"organization_name"`
}

type Page

type Page struct {
	User    User
	Payload interface{}
}

type Post

type Post struct {
	ID    int           `json:"post_id"`
	User  int           `json:"user_id"`
	Topic int           `json:"topic_id"`
	Guid  string        `json:"post_guid"`
	Text  string        `json:"post_text"`
	FText template.HTML `json:"post_ftext"`
	Time  int           `json:"post_create_time"`
}

func GetPost

func GetPost(guid string) Post

type Posts

type Posts []Post

type Publication

type Publication struct {
	ID           int    `json:"publication_id"`
	Organization int    `json:"organization_id"`
	Name         string `json:"publication_name"`
	Guid         string `json:"publication_guid"`
}

type QueryData

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

func NewQueryData

func NewQueryData() QueryData

func (*QueryData) Generate

func (q *QueryData) Generate(opts url.Values)

type Session

type Session struct {
	ID string
}

type Topic

type Topic struct {
	ID        int     `json:"topic_id"`
	Title     string  `json:"topic_title"`
	Guid      string  `json:"topic_guid"`
	ForumID   int     `json:"forum_id"`
	ForumGuid string  `json:"forum_guid"`
	ForumName string  `json:"forum_name"`
	User      int     `json:"user_id"`
	Time      int     `json:"topic_create_time"`
	Topics    []Topic `json:"topic_topics"`
	Posts     []Post  `json:"posts"`
}

func GetTopic

func GetTopic(guid string) Topic

func (Topic) GetPosts

func (t Topic) GetPosts() []Post

type User

type User struct {
	ID       int    `json:"user_id"`
	Guid     string `json:"user_guid"`
	Name     string `json:"user_name"`
	Email    string `json:"user_email"`
	Password string `json:"user_password"`
	LoggedIn bool   `json:"logged_in"`
}

func GetSession

func GetSession(r *http.Request) User

func GetUser

func GetUser(guid string) User

type Users

type Users struct {
	Users []User `json:"users"`
}

func GetUsers

func GetUsers(opts url.Values) *Users

Jump to

Keyboard shortcuts

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