Documentation ¶ Index ¶ type Auth func NewAuth(authKey []byte) *Auth func (a Auth) CreateToken(c *UserClaim) (string, error) func (a Auth) ParseToken(signedToken string) (*UserClaim, error) type IAuth type UserClaim func (uc *UserClaim) Compare(compareTo *UserClaim) (bool, error) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Auth ¶ type Auth struct { AuthKey []byte } func NewAuth ¶ func NewAuth(authKey []byte) *Auth func (Auth) CreateToken ¶ func (a Auth) CreateToken(c *UserClaim) (string, error) func (Auth) ParseToken ¶ func (a Auth) ParseToken(signedToken string) (*UserClaim, error) type IAuth ¶ type IAuth interface { CreateToken(c *UserClaim) (string, error) ParseToken(signedToken string) (*UserClaim, error) } type UserClaim ¶ type UserClaim struct { jwt.RegisteredClaims Email string } func (*UserClaim) Compare ¶ func (uc *UserClaim) Compare(compareTo *UserClaim) (bool, error) Source Files ¶ View all Source files auth.go Click to show internal directories. Click to hide internal directories.