3
0
corteza/auth/auth.go
2018-07-29 16:37:41 +02:00

27 lines
328 B
Go

package auth
type (
Identifiable interface {
Identity() uint64
Valid() bool
}
Identity struct {
identity uint64
}
)
func NewIdentity(id uint64) *Identity {
return &Identity{
identity: id,
}
}
func (i Identity) Identity() uint64 {
return i.identity
}
func (i Identity) Valid() bool {
return i.identity > 0
}