settings

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2018 License: MIT Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger *logrus.Logger

Logger is the injected variable for global logger

Functions

func GenerateClientConfigFile

func GenerateClientConfigFile(config FullClientSettings, authString string)

GenerateClientConfigFile runs at first run (no db client detected) to generate a js file for connecting

func GenerateSigningKey

func GenerateSigningKey() []byte

GenerateSigningKey creates a random key that will be used for JSON Web Token authentication

func GenerateToken

func GenerateToken(claims GoTorrentClaims, signingKey []byte) string

GenerateToken creates a signed token for a client to use to communicate with the server

Types

type AuthRequest

type AuthRequest struct {
	MessageType string `json:"MessageType"`
	AuthString  string `json:"AuthString"`
}

AuthRequest is a struct sent by a client with an authstring (JWT Token) to validate they have access to the server

type ClientConnectSettings added in v0.4.0

type ClientConnectSettings struct {
	HTTPAddr            string
	HTTPAddrIP          string
	UseProxy            bool
	WebsocketClientPort string
	BaseURL             string
	ClientUsername      string
	ClientPassword      string
	PushBulletToken     string `json:"-"`
}

type FullClientSettings

type FullClientSettings struct {
	ID                 int `storm:"id,unique"`
	LoggingLevel       logrus.Level
	LoggingOutput      string
	Version            int
	TorrentConfig      torrent.Config `json:"-"`
	TFileUploadFolder  string
	SeedRatioStop      float64
	DefaultMoveFolder  string
	TorrentWatchFolder string
	ClientConnectSettings
}

FullClientSettings contains all of the settings for our entire application

func FullClientSettingsNew

func FullClientSettingsNew() FullClientSettings

FullClientSettingsNew creates a new set of setting from config.toml

type GoTorrentClaims

type GoTorrentClaims struct {
	ClientName string `json:"clientName"`
	jwt.StandardClaims
}

GoTorrentClaims stores the name of the client (usually user entered) and any standard jwt claims we want to define

type TokenReturn added in v0.4.0

type TokenReturn struct {
	MessageType string `json:"MessageType"`
	TokenReturn string `json:"TokenReturn"`
}

TokenReturn is a struct sent by the server to a client with a new generated authstring

Jump to

Keyboard shortcuts

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