utils

package
v0.0.0-...-97a9045 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(r *http.Request) bool

BasicAuth Middleware for handling http basic auth (unused)

Types

type Response

type Response struct {
	Status   int
	Message  string
	Token    string
	CWD      string
	DirFiles []string
}

Response Response format from server to client

type Session

type Session struct {
	Token    string    // token
	CWD      string    // current working directory
	LastUsed time.Time // last action time
}

Session An open session between client and server

func RemoveFromSlice

func RemoveFromSlice(s []Session, i int) []Session

RemoveFromSlice Remove a session from a slice

func SessionExist

func SessionExist(sessions []Session, token string) (Session, int, bool)

SessionExist Check if a token is for one of the existinng sessions

Jump to

Keyboard shortcuts

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