epic

package
v0.0.0-...-2d16bb2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2017 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SALT_BYTES = 64
	HASH_BYTES = 64
)

Variables

This section is empty.

Functions

func AboutHandler

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

func AppID

func AppID(appCode string) (uuid.UUID, error)

func AssetUploadURLHandler

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

func AssignTagToContentHandler

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

func AuthHandler

func AuthHandler(h http.Handler) http.Handler

func Authenticate

func Authenticate(data string) (map[string]interface{}, error)

func AuthenticateTokenHandler

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

func CreateApplication

func CreateApplication(Name string, Code string) (uuid.UUID, error)

func CreateApplicationHandler

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

func CreateContentReservation

func CreateContentReservation(c *Content) error

func CreateContentReservationHandler

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

func CreateEntryForContentID

func CreateEntryForContentID(e *Entry) error

func CreateTag

func CreateTag(tag string, appID string) error

func CreateTagHandler

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

func CreateUserHandler

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

func DeleteTagHandler

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

func DeleteUser

func DeleteUser(userID string, appID string) error

func DeleteUserHandler

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

func GetUserHandler

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

func IndexHandler

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

func InstallPostgreSQLDatabase

func InstallPostgreSQLDatabase(adminUser string, adminPassword string, server string, database string, epicPassword string) (string, error)

func ListContentHandler

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

func ListTagsHandler

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

func Logger

func Logger(inner http.Handler, name string) http.Handler

func LoginHandler

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

func Logout

func Logout(userID string) error

func LogoutHandler

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

func NewRouter

func NewRouter() *mux.Router

func NewUUID

func NewUUID() string

func NewUUIDHandler

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

func ReadAllContentForTagHandler

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

func ReadContentHandler

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

func ReadNewestLocalizedContentEntriesForTagHandler

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

func ResetPassword

func ResetPassword(email string, appID string) error

func ResetPasswordHandler

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

func ServeAll

func ServeAll(user string, password string, server string, database string) error

func ServeHTTP

func ServeHTTP(port int, host string, password string, server string, database string)

func ServeHTTPS

func ServeHTTPS(user string, password string, server string, database string) error

func ServeRedirect

func ServeRedirect(user string, password string, server string, database string) error

func TagContent

func TagContent(contentID string, tag string, AppID string) error

func UninstallPostgreSQLDatabase

func UninstallPostgreSQLDatabase(adminUser string, adminPassword string, server string, database string) error

func UpdateContentHandler

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

func UpdatePassword

func UpdatePassword(password string, userID string) error

func UpdatePasswordHandler

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

func UserCryptoBootstrapHandler

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

Types

type About

type About struct {
	Name    string
	Version string
	Website string
}

type App

type App struct {
	ID   uuid.UUID `json:"id, omitempty"`
	Name string    `json:"name, omitempty"`
	Code string    `json:"code, omitempty"`
}

type Content

type Content struct {
	ID          uuid.UUID `json:"id, omitempty"`
	AppID       uuid.UUID `json:"app-id, omitempty"`
	Name        string    `json:"name, omitempty"`
	Description string    `json:"description, omitempty"`
	Error       error     `json:"error, omitempty"`
}

type Entry

type Entry struct {
	ID        uuid.UUID `json:"-"`
	ContentID uuid.UUID `json:"id"`
	Locale    string    `json:"locale"`
	Timestamp time.Time `json:"timestamp"`
	Data      string    `json:"data"`
}

func AllContentForTag

func AllContentForTag(Tag string, AppID string) ([]Entry, error)

func NewestEntryForContentID

func NewestEntryForContentID(contentID string) (*Entry, error)

func NewestLocalizedContentEntriesForTag

func NewestLocalizedContentEntriesForTag(Tag string, Locale string, AppID string) ([]Entry, error)

type Err

type Err struct {
	Code int    `json:"code"`
	Text string `json:"text"`
}

type ID

type ID struct {
	ID string `json:"id"`
}

type Reset

type Reset struct {
	Email string `json:"email"`
	AppID string `json:"app-id"`
}

type Role

type Role struct {
	ID    uuid.UUID `json:"id, omitempty"`
	Names string    `json:"name, omitempty"`
}

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

type Routes

type Routes []Route

type S3PutRequest

type S3PutRequest struct {
	Bucket string `json:"bucket"`
	Key    string `json:"key"`
	URL    string `json:"url"`
	Error  string `json:"error"`
}

type UUID

type UUID struct {
	UUID string `json:"uuid"`
}

type User

type User struct {
	ID           uuid.UUID  `json:"id, omitempty"`
	FirstName    string     `json:"first-name, omitempty"`
	LastName     string     `json:"last-name, omitempty"`
	Email        string     `json:"email, omitempty"`
	AppID        uuid.UUID  `json:"app-id, omitempty"`
	Username     string     `json:"username, omitempty"`
	Password     string     `json:"password, omitempty"`
	Salt         string     `json:"salt, omitempty"`
	PrivateKey   string     `json:"private-key, omitempty"`
	PublicKey    string     `json:"public-key, omitempty"`
	Token        *string    `json:"token, omitempty"`
	TokenExpires *time.Time `json:"token-expires, omitempty"`
}

func CreateUser

func CreateUser(user *User) (*User, error)

func GetAllUsers

func GetAllUsers(appID string) ([]User, error)

func GetUser

func GetUser(id string, appID string) (*User, error)

func GetUserFromEmail

func GetUserFromEmail(email string, appID string) (*User, error)

func Login

func Login(user *User) (*User, error)

type UserCryptoBootstrap

type UserCryptoBootstrap struct {
	PlainText  string `json:"plain-text, omitempty"`
	Hash       string `json:"hash, omitempty"`
	Salt       string `json:"salt, omitempty"`
	PrivateKey string `json:"private-key, omitempty"`
	PublicKey  string `json:"public-key, omitempty"`
}

Jump to

Keyboard shortcuts

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