17 lines
431 B
Go
17 lines
431 B
Go
package token
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
// Maker is an interface for managing tokens
|
|
type Maker interface {
|
|
// CreateToken creates a new token for a specific username and duration
|
|
CreateToken(uuid uuid.UUID, username string, duration time.Duration, tokenType Type) (string, *Payload, error)
|
|
|
|
// VerifyToken checks if the token is valid or not
|
|
VerifyToken(token string, tokenType Type) (*Payload, error)
|
|
}
|