Documentation ¶
Index ¶
- Variables
- type ChangeMultipleSettings
- type ChangeUserSetting
- type Client
- type CreateServerResponse
- type Deployment
- type GetServerResponse
- type Node
- type NodeView
- type NodesView
- type PermissionView
- type Permissions
- type Server
- type ServerCreation
- type ServerSearchResponse
- type ServerUserView
- type ServerView
- type ServerWithName
- type Session
- type Setting
- type Template
- type TemplateRepo
- type User
- type UserPermissionsView
- type UserSearch
- type UserSearchResponse
- type UserSetting
- type UserSettingView
- type UserSettingsView
- type UserView
Constants ¶
This section is empty.
Variables ¶
View Source
var LocalNode = &Node{
ID: 0,
Name: "LocalNode",
PublicHost: "127.0.0.1",
PrivateHost: "127.0.0.1",
PublicPort: 8080,
PrivatePort: 8080,
SFTPPort: 5657,
}
Functions ¶
This section is empty.
Types ¶
type ChangeMultipleSettings ¶
type ChangeMultipleSettings map[string]interface{} //@name ChangeMultipleSettings
type ChangeUserSetting ¶
type ChangeUserSetting struct { Value string `json:"value"` } //@name UserSetting
type Client ¶
type Client struct { ID uint `gorm:"PRIMARY_KEY,AUTO_INCREMEMT" json:"-"` ClientId string `gorm:"NOT NULL;uniqueIndex" json:"client_id"` HashedClientSecret string `gorm:"column:client_secret;NOT NULL" json:"-"` ClientSecret string `gorm:"-" json:"client_secret"` UserId uint `gorm:"NOT NULL" json:"-"` User *User `json:"-"` Name string `gorm:"column:name;NOT NULL;size:100;default\"\"" json:"name"` Description string `gorm:"column:description;NOT NULL;size:4000;default:\"\"" json:"description"` }
func (*Client) SetClientSecret ¶
func (*Client) ValidateSecret ¶
type CreateServerResponse ¶
type CreateServerResponse struct { Id string `json:"id"` } //@name CreatedServerId
type Deployment ¶
type GetServerResponse ¶
type GetServerResponse struct { Server *ServerView `json:"server"` Perms *PermissionView `json:"permissions"` } //@name GetServer
type Node ¶
type Node struct { ID uint `json:"-"` Name string `gorm:"size:100;UNIQUE;NOT NULL" json:"-" validate:"required,printascii"` PublicHost string `gorm:"size:100;NOT NULL" json:"-" validate:"required,ip|fqdn"` PrivateHost string `gorm:"size:100;NOT NULL" json:"-" validate:"required,ip|fqdn"` PublicPort uint16 `gorm:"DEFAULT:8080;NOT NULL" json:"-" validate:"required,min=1,max=65535,nefield=SFTPPort"` PrivatePort uint16 `gorm:"DEFAULT:8080;NOT NULL" json:"-" validate:"required,min=1,max=65535,nefield=SFTPPort"` SFTPPort uint16 `gorm:"DEFAULT:5657;NOT NULL" json:"-" validate:"required,min=1,max=65535,nefield=PublicPort,nefield=PrivatePort"` Secret string `gorm:"size=36;NOT NULL" json:"-" validate:"required"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
type NodeView ¶
type NodeView struct { Id uint `json:"id"` Name string `json:"name,omitempty"` PublicHost string `json:"publicHost,omitempty"` PrivateHost string `json:"privateHost,omitempty"` PublicPort uint16 `json:"publicPort,omitempty"` PrivatePort uint16 `json:"privatePort,omitempty"` SFTPPort uint16 `json:"sftpPort,omitempty"` Local bool `json:"isLocal"` } //@name Node
func (*NodeView) CopyToModel ¶
type PermissionView ¶
type PermissionView struct { ServerIdentifier string `json:"serverIdentifier,omitempty"` Scopes []*pufferpanel.Scope `json:"scopes"` } //@name Permissions
func FromPermission ¶
func FromPermission(p *Permissions) *PermissionView
type Permissions ¶
type Permissions struct { ID uint `gorm:"primaryKey,autoIncrement" json:"-"` //owners of this permission set UserId *uint `json:"-"` User User `gorm:"ASSOCIATION_SAVE_REFERENCE:false" json:"-" validate:"-"` ClientId *uint `json:"-"` Client Client `gorm:"ASSOCIATION_SAVE_REFERENCE:false" json:"-" validate:"-"` //if this set is for a server, what server ServerIdentifier *string `json:"-"` Server Server `gorm:"ASSOCIATION_SAVE_REFERENCE:false" json:"-" validate:"-"` RawScopes string `gorm:"column:scopes;NOT NULL;DEFAULT:''" json:"-" validate:"required"` Scopes []*pufferpanel.Scope `gorm:"-" json:"-"` }
func (*Permissions) BeforeSave ¶
func (p *Permissions) BeforeSave(*gorm.DB) error
func (*Permissions) ShouldDelete ¶
func (p *Permissions) ShouldDelete() bool
type Server ¶
type Server struct { Name string `gorm:"size:40;NOT NULL" json:"-" validate:"required,printascii"` Identifier string `gorm:"UNIQUE;NOT NULL;primaryKey;size:8" json:"-" validate:"required,printascii"` RawNodeID *uint `gorm:"column:node_id" json:"-"` NodeID uint `gorm:"-" json:"-" validate:"-"` Node Node `gorm:"ASSOCIATION_SAVE_REFERENCE:false;foreignKey:RawNodeID" json:"-" validate:"-"` IP string `gorm:"" json:"-" validate:"omitempty,ip|fqdn"` Port uint16 `gorm:"" json:"-" validate:"omitempty"` Type string `gorm:"NOT NULL;default='generic'" json:"-" validate:"required,printascii"` Icon string `gorm:"" json:"-"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
type ServerCreation ¶
type ServerSearchResponse ¶
type ServerSearchResponse struct { Servers []*ServerView `json:"servers"` *pufferpanel.Metadata } //@name ServerSearchResults
type ServerUserView ¶
type ServerView ¶
type ServerView struct { Identifier string `json:"id,omitempty"` Name string `json:"name,omitempty"` NodeId uint `json:"nodeId,omitempty"` Node *NodeView `json:"node,omitempty"` Data interface{} `json:"data,omitempty"` Users []ServerUserView `json:"users,omitempty"` IP string `json:"ip,omitempty"` Port uint16 `json:"port,omitempty"` Type string `json:"type"` Icon string `json:"icon,omitempty"` CanGetStatus bool `json:"canGetStatus,omitempty"` } //@name ServerInfo
func FromServer ¶
func FromServer(server *Server) *ServerView
func FromServers ¶
func FromServers(servers []*Server) []*ServerView
func RemoveServerPrivateInfo ¶
func RemoveServerPrivateInfo(server *ServerView) *ServerView
func RemoveServerPrivateInfoFromAll ¶
func RemoveServerPrivateInfoFromAll(servers []*ServerView) []*ServerView
func (*ServerView) Valid ¶
func (s *ServerView) Valid(allowEmpty bool) error
type ServerWithName ¶
type ServerWithName struct { pufferpanel.Server Name string `json:"name"` } //@name NamedServer
type Session ¶
type Session struct { ID uint `gorm:"primaryKey,autoIncrement" json:"-"` Token string `gorm:"unique;size:64;not null" json:"-"` ExpirationTime time.Time `gorm:"not null" json:"-"` UserId *uint `json:"-"` User User `gorm:"ASSOCIATION_SAVE_REFERENCE:false" json:"-" validate:"-"` ClientId *uint `json:"-"` Client Client `gorm:"ASSOCIATION_SAVE_REFERENCE:false" json:"-" validate:"-"` //if this set is for a server, what server ServerIdentifier *string `json:"-"` Server Server `gorm:"ASSOCIATION_SAVE_REFERENCE:false" json:"-" validate:"-"` }
type Template ¶
type TemplateRepo ¶
type TemplateRepo struct { ID uint `gorm:"primaryKey" json:"id"` Name string `gorm:"type:varchar(100);" json:"name"` Url string `gorm:"type:text" json:"url"` Branch string `gorm:"type:text" json:"branch"` PAT string `json:"-"` Username string `json:"-"` Password string `json:"-"` SSHKey string `json:"-"` IsLocal bool `gorm:"-" json:"isLocal"` } //@name TemplateRepo
type User ¶
type User struct { ID uint `json:"-"` Username string `gorm:"UNIQUE;NOT NULL;size:100" json:"-" validate:"required,printascii,max=100,min=5"` Email string `gorm:"UNIQUE;NOT NULL;size:255" json:"-" validate:"required,email,max=255"` HashedPassword string `gorm:"column:password;NOT NULL;size:200" json:"-" validate:"required,max=200"` OtpSecret string `gorm:"size:32" json:"-"` OtpActive bool `gorm:"NOT NULL;DEFAULT:0" json:"-"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
func (*User) SetPassword ¶
type UserPermissionsView ¶
type UserSearch ¶
type UserSearchResponse ¶
type UserSearchResponse struct { Users []*UserView `json:"users"` *pufferpanel.Metadata } //@name UserSearchResponse
type UserSetting ¶
type UserSettingView ¶
type UserSettingView struct { Key string `json:"key"` Value string `json:"value"` } //@name UserSettings
func FromUserSetting ¶
func FromUserSetting(setting *UserSetting) *UserSettingView
type UserSettingsView ¶
type UserSettingsView []*UserSettingView
func FromUserSettings ¶
func FromUserSettings(settings []*UserSetting) UserSettingsView
type UserView ¶
type UserView struct { Id uint `json:"id,omitempty"` Username string `json:"username,omitempty"` Email string `json:"email,omitempty"` //ONLY SHOW WHEN COPYING Password string `json:"password,omitempty"` NewPassword string `json:"newPassword,omitempty"` } //@name User
func (*UserView) CopyToModel ¶
func (*UserView) EmailValid ¶
func (*UserView) UserNameValid ¶
Click to show internal directories.
Click to hide internal directories.