Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct { *rpc.Token ID pr.ObjectID `bson:"_id"` Email string `validator:"email"` Expires time.Time }
Model represents a model to store a token.
type Server ¶
type Server struct { *timeout.Timeout Now func() time.Time Validator *vld.Validate // contains filtered or unexported fields }
Server is a Token RPC Implementation structure.
func New ¶
func New( adapter adapter.IAdapter, tokSize int, maxAge time.Duration, opTimeout time.Duration, randomTxtSeed ...string, ) *Server
New creates a new Token RPC Server Instance. If randomTxtSeed is empty/nil/zero-value, this service will generate random token from ascii letters. i.e. the generated token will be matched with [a-zA-Z0-9]{tokSize}
func (*Server) CleanRottedToken ¶
func (me *Server) CleanRottedToken()
CleanRottedToken removes rotted token from the DB.
Click to show internal directories.
Click to hide internal directories.