npk

package module
v0.0.0-...-7cdc9e7 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2020 License: MIT Imports: 11 Imported by: 0

README

npk-common

Common

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaseTemplate = `` /* 453-byte string literal not displayed */
View Source
var DashboardTpl = `
{{template "base" .}}

{{define "toolbar"}}{{end}}

{{define "main"}}
<p>User: {{.}}</p>
{{end}}
`
View Source
var Navbar = `` /* 357-byte string literal not displayed */
View Source
var (
	Store *sessions.CookieStore //= sessions.NewCookieStore(key)
)

Functions

func Authenticated

func Authenticated(next http.HandlerFunc) http.HandlerFunc

func DBConnection

func DBConnection(config Configuration) (*sql.DB, error)

func DisableCache

func DisableCache(next http.HandlerFunc) http.HandlerFunc

func SetupRoutes

func SetupRoutes(r *mux.Router)

func SetupSessionStore

func SetupSessionStore(config Configuration)

func UserIdByUsername

func UserIdByUsername(un string) uuid.UUID

Types

type Configuration

type Configuration struct {
	Database   DatabaseConfig
	SessionKey string
	Listen     string
}

type DatabaseConfig

type DatabaseConfig struct {
	Host     string
	Port     string
	SSLMode  string
	Username string
	Password string
	Catalog  string
}

type User

type User struct {
	Id        uuid.UUID
	Username  string
	Password  string
	CreatedAt time.Time
	Status    string
}

Jump to

Keyboard shortcuts

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