Documentation ¶
Index ¶
- Constants
- func AddContext(ctx dtos.PunqContext) (*dtos.PunqContext, error)
- func AddUser(userCreateInput dtos.PunqUserCreateInput) (*dtos.PunqUser, error)
- func CreateAdminUser()
- func CreateUserSecret()
- func DeleteContext(id string) (interface{}, error)
- func DeleteUser(id string) error
- func GenerateToken(user *dtos.PunqUser) (*dtos.PunqToken, error)
- func GetAdmin() (*dtos.PunqUser, error)
- func GetContext(id string) (*dtos.PunqContext, error)
- func GetGinContextId(c *gin.Context) *string
- func GetGinContextUser(c *gin.Context) *dtos.PunqUser
- func GetOwnContext() (*dtos.PunqContext, error)
- func GetUser(id string) (*dtos.PunqUser, error)
- func GetUserByEmail(email string) (*dtos.PunqUser, error)
- func InitAuthService()
- func InitUserService()
- func ListContexts() []dtos.PunqContext
- func ListUsers() []dtos.PunqUser
- func RemoveKeyPair()
- func UpdateContext(ctx dtos.PunqContext) (interface{}, error)
- func UpdateUser(userUpdateInput dtos.PunqUser) (*dtos.PunqUser, error)
- type KeyPair
- type PunqClaims
Constants ¶
View Source
const ( SecKeyPair = "keyPair" TokenExpHours = 24 * 7 // 1 week )
View Source
const PunqAdminIdKey = "admin_id"
Variables ¶
This section is empty.
Functions ¶
func AddContext ¶
func AddContext(ctx dtos.PunqContext) (*dtos.PunqContext, error)
func CreateAdminUser ¶ added in v1.2.0
func CreateAdminUser()
func CreateUserSecret ¶ added in v1.2.0
func CreateUserSecret()
func DeleteContext ¶
func DeleteUser ¶
func GenerateToken ¶ added in v1.2.0
func GetContext ¶
func GetContext(id string) (*dtos.PunqContext, error)
func GetGinContextId ¶ added in v1.2.1
func GetOwnContext ¶
func GetOwnContext() (*dtos.PunqContext, error)
func InitAuthService ¶ added in v1.2.0
func InitAuthService()
func InitUserService ¶ added in v1.2.0
func InitUserService()
func ListContexts ¶
func ListContexts() []dtos.PunqContext
func RemoveKeyPair ¶ added in v1.2.0
func RemoveKeyPair()
func UpdateContext ¶
func UpdateContext(ctx dtos.PunqContext) (interface{}, error)
Types ¶
type KeyPair ¶ added in v1.2.0
type KeyPair struct { PrivateKeyString string `json:"privateKey" validate:"required"` PublicKeyString string `json:"publicKey" validate:"required"` PrivateKey *ecdsa.PrivateKey `json:"-"` PublicKey any `json:"-"` }
var KeyPairInstance *KeyPair
func CreateKeyPair ¶ added in v1.2.0
func GetKeyPair ¶ added in v1.2.0
func (*KeyPair) UnmarshalJSON ¶ added in v1.2.0
type PunqClaims ¶ added in v1.2.0
type PunqClaims struct { UserID string `json:"userId"` jwt.RegisteredClaims }
func ValidationToken ¶ added in v1.2.0
func ValidationToken(tokenString string) (*PunqClaims, error)
Click to show internal directories.
Click to hide internal directories.