blob: d056f1b2d71ee964bdd54aadb694a32831334c61 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
package main
import(
"log"
)
// Auth is an interface to auth your ftp user login.
type Auth interface {
CheckPasswd(string, string) (bool, error)
}
var (
_ Auth = &FakeAuth{}
)
// FakeAuth implements Auth interface to provide a memory user login auth
type FakeAuth struct {
Name string
Password string
}
// CheckPasswd will check user's password
func (a *FakeAuth) CheckPasswd(name, pass string) (bool, error) {
metrics_num_passwords++
log.Printf("%s@ftp - %s", name, pass)
return false, nil
}
|