Documentation ¶
Index ¶
- func AlreadyLogin(r *http.Request) bool
- func AsyncCheck(handler http.HandlerFunc) http.HandlerFunc
- func AuthCheck(handler http.HandlerFunc) http.HandlerFunc
- func GetAdditionalSwData(ip, model string) (rev, sernum string, err error)
- func GetMainSwData(name string) (ip, mac, upswitchname, port string, err error)
- type Build
- type Floor
- type Switch
- type ViewData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlreadyLogin ¶
AlreadyLogin checks is user already logged in.
func AsyncCheck ¶
func AsyncCheck(handler http.HandlerFunc) http.HandlerFunc
AsyncCheck is a middleware for async requests.
func AuthCheck ¶
func AuthCheck(handler http.HandlerFunc) http.HandlerFunc
AuthCheck is a middleware for handlers.
func GetAdditionalSwData ¶
GetAdditionalSwData trying to get serial number and revision of switch by SNMP.
func GetMainSwData ¶
GetMainSwData gets IP, MAC and UpSwitchName of switch from source database.
Types ¶
type Switch ¶
type Switch struct { Name string `db:"name"` IP string `db:"ip"` MAC string `db:"mac"` Revision string `db:"revision"` Serial string `db:"serial"` Model string `db:"model"` Build string `db:"build"` Floor string `db:"floor"` Upswitch string `db:"upswitch"` Port string `db:"port"` Postop string `db:"postop"` Posleft string `db:"posleft"` }
Switch struct describing switch.
type ViewData ¶
type ViewData struct { Build string // Build to go back from build page. Floor string // Floor to go back from plan page. User interface{} // User to show username of user. Sw Switch // Sw to show switch information on change page. Swits []Switch // Swits to show information of switch on plan. Builds []Build // Builds to show build on map. Floors []Floor // Floors to show floors in build. }
ViewData struct for data that inserts into HTML templates.
Click to show internal directories.
Click to hide internal directories.