Documentation ¶
Index ¶
- Variables
- func CreateSession(user User, secondsToLive int, secret string) (string, error)
- func GetLocalIP() string
- func HashPassword(password, salt string) string
- func LoadUsers(filename string) error
- type AuthenticationArgs
- type AuthenticationReply
- type AuthenticationService
- type HealthArgs
- type HealthReply
- type HealthService
- type Session
- type SessionDetailsArgs
- type SessionInterface
- type SessionService
- func (t *SessionService) Details(r *http.Request, args *SessionDetailsArgs, result *Session) error
- func (t *SessionService) NewSession(user User) (string, error)
- func (t *SessionService) Validate(r *http.Request, args *SessionValidateArgs, result *SessionValidateReply) error
- func (t *SessionService) Version(r *http.Request, args *string, result *string) error
- type SessionValidateArgs
- type SessionValidateReply
- type StatsArgs
- type StatsReply
- type StatsService
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ApplicationSessionService = new(SessionService)
Session stuff
View Source
var SessionPeriod *int
View Source
var SessionSecret *string
Application Parameters
View Source
var StatsMiddleware = stats.New()
Contains the global variables used
View Source
var UserFile *string // Known users
View Source
var Version string = "0.8"
Version
Functions ¶
func CreateSession ¶
CreateSession - creates a sesion WITHOUT adding it to the session DB
func GetLocalIP ¶
func GetLocalIP() string
func HashPassword ¶
Types ¶
type AuthenticationArgs ¶
type AuthenticationReply ¶
type AuthenticationReply struct {
Token string `json:"token"`
}
type AuthenticationService ¶
type AuthenticationService int
func (*AuthenticationService) Authenticate ¶
func (t *AuthenticationService) Authenticate(r *http.Request, args *AuthenticationArgs, result *AuthenticationReply) error
type HealthArgs ¶
type HealthArgs struct { }
type HealthReply ¶
type HealthReply struct {
Status string `json:"status"`
}
type HealthService ¶
type HealthService int
func (*HealthService) Status ¶
func (t *HealthService) Status(r *http.Request, args *HealthArgs, result *HealthReply) error
type Session ¶
type SessionDetailsArgs ¶
type SessionDetailsArgs struct { Authorization string `json:"authorization"` Token string `json:"token"` }
SessionDetailsArgs a struct with a field 'authorization' containing callers token and 'token' which is the token to decode. Requires caller to have admin role and
type SessionInterface ¶
type SessionInterface interface {
// contains filtered or unexported methods
}
type SessionService ¶
type SessionService int
func (*SessionService) Details ¶
func (t *SessionService) Details(r *http.Request, args *SessionDetailsArgs, result *Session) error
List available sessions
func (*SessionService) NewSession ¶
func (t *SessionService) NewSession(user User) (string, error)
NewSession - creates a session and add its to the session DB
func (*SessionService) Validate ¶
func (t *SessionService) Validate(r *http.Request, args *SessionValidateArgs, result *SessionValidateReply) error
Verifies is a token is valid - public
type SessionValidateReply ¶
type SessionValidateReply bool
type StatsReply ¶
type StatsService ¶
type StatsService int
func (*StatsService) Status ¶
func (t *StatsService) Status(r *http.Request, args *StatsArgs, result *StatsReply) error
Click to show internal directories.
Click to hide internal directories.