Documentation
¶
Overview ¶
Package server generated by go-bindata.// sources: assets/files/css/dashboard.css assets/files/fonts/FontAwesome.otf assets/files/fonts/fontawesome-webfont.ttf assets/files/fonts/fontawesome-webfont.woff assets/files/fonts/fontawesome-webfont.woff2 assets/files/img/clear.png assets/files/img/container/R.svg assets/files/img/container/dockerfile.svg assets/files/img/container/golang.svg assets/files/img/container/groovy.svg assets/files/img/container/javascript.svg assets/files/img/container/jupyter.svg assets/files/img/container/perl.svg assets/files/img/container/php.svg assets/files/img/container/python.svg assets/files/img/container/ruby.svg assets/files/img/container/sh.svg assets/files/img/dashboard-logo-white.svg assets/files/img/dashboard-logo.svg assets/files/img/eclipse.svg assets/files/img/kubernetes/daemonset.svg assets/files/img/kubernetes/deployment.svg assets/files/img/kubernetes/statefulset.svg assets/files/img/pulse.svg assets/files/img/source/directory.svg assets/files/img/source/file.svg assets/files/img/source/stream.svg assets/files/js/api.js assets/files/js/collections/collection.js assets/files/js/collections/container.js assets/files/js/collections/kubernetes.js assets/files/js/collections/link.js assets/files/js/collections/source.js assets/files/js/lib/jquery.editable.min.js assets/files/js/page.js assets/files/js/pipeline.js assets/files/js/router.js assets/templates/configure.tpl assets/templates/error.tpl assets/templates/footer.html assets/templates/header.html assets/templates/index.tpl assets/templates/login.tpl
Copyright 2021 The Tiyo authors ¶
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
Package server : A webserver base GUI and API for managing a server.apiDB
Copyright 2021 The Tiyo authors ¶
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
Index ¶
- Constants
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func LoadTemplates(paths ...string) *template.Template
- func Logger(logfile string, notLogged ...string) gin.HandlerFunc
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type BinFileSystem
- type Group
- type Lockable
- type Permission
- type Server
- func (s *Server) AddGroup(group *Group) error
- func (s *Server) AddMachine(address string) string
- func (s *Server) AddPermission(name string) (string, error)
- func (s *Server) AddUser(user *User) error
- func (server *Server) Configure(c *gin.Context)
- func (s *Server) CreateTables() error
- func (s *Server) DeleteGroup(name string) error
- func (s *Server) DeletePermission(name string) error
- func (s *Server) DeleteUser(user *User) error
- func (server *Server) Engine() *gin.Engine
- func (server *Server) Error(c *gin.Context, code int, err error)
- func (s *Server) FindGroup(name string) (*Group, error)
- func (s *Server) FindGroupByID(id string) (*Group, error)
- func (s *Server) FindMachine(address string) string
- func (s *Server) FindUser(email string) (*User, error)
- func (server *Server) Index(c *gin.Context)
- func (server *Server) Init()
- func (server *Server) RequireAccount(c *gin.Context)
- func (server *Server) Run() int
- func (server *Server) Signin(c *gin.Context)
- func (server *Server) Signout(c *gin.Context)
- func (server *Server) ValidateSession(session sessions.Session) error
- type User
Constants ¶
const ( USERS_T = "users" USERGROUPS_T = "groups" PASSW_T = "passwords" TOTP_T = "totp" GROUP_T = "group" GROUP_PERMS_T = "groupperms" ACL_T = "acl" PERM_T = "permissions" MACHINE_TOKENS = "machines" MACHINE_HMAC = "hmac" )
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("nonexistent") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func LoadTemplates ¶
LoadTemplates : Load HTML template files
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type BinFileSystem ¶
type BinFileSystem struct { FileSystem http.FileSystem Root string }
BinFileSystem : Binary file system for serving compiled assets
func GetBinFileSystem ¶
func GetBinFileSystem(root string) *BinFileSystem
GetBinFileSystem : Get the binary filesystem object
func (*BinFileSystem) Collection ¶
func (binFS *BinFileSystem) Collection(c *gin.Context)
Collection : Load a collection of files from the filsystem and send them back over the assigned gin.Context
type Group ¶
type Group struct { ID string Name string Permissions []Permission }
type Permission ¶
type Server ¶
type Server struct { // The name of the database file Dbname string // The port to listen on Port string // The address of the server component Address string // contains filtered or unexported fields }
Server : The principle server component
func (*Server) AddMachine ¶
func (*Server) CreateTables ¶
func (*Server) DeleteGroup ¶
func (*Server) DeletePermission ¶
func (*Server) DeleteUser ¶
func (*Server) FindMachine ¶
func (*Server) Index ¶
Index : Render the index page back on the GIN context
TODO : Make this a little more versatile and use SSR to render
more of the page than relying on JS and a one page website