auth

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmptyRes

type EmptyRes struct{}

type LoginInput

type LoginInput struct {
	Username string `json:"username" dc:"username" v:"required"`
	Password string `json:"password" dc:"password" v:"required"`
}

type LoginOutput

type LoginOutput struct {
	TokenType        string `json:"tokenType" dc:"Token type, default is Bearer"`
	Token            string `json:"token" dc:"Access token"`
	ExpireIn         int64  `json:"expireIn" dc:"Access token lifetime in seconds"`
	ExpiresAt        string `json:"expiresAt" dc:"Access token expiry in RFC3339"`
	RefreshToken     string `json:"refreshToken" dc:"One-time refresh token"`
	RefreshExpiresAt string `json:"refreshExpiresAt" dc:"Refresh expiry in RFC3339"`
	Refreshable      bool   `json:"refreshable" dc:"Whether one refresh remains"`
	Username         string `json:"username" dc:"username"`
}

type LoginReq

type LoginReq struct {
	g.Meta `path:"/login" method:"post" tags:"auth" summary:"login"`
	LoginInput
}

type LoginRes

type LoginRes = LoginOutput

type LogoutInput added in v1.2.0

type LogoutInput struct {
	RefreshToken string `json:"refreshToken"`
}

type LogoutReq

type LogoutReq struct {
	g.Meta `path:"/logout" method:"post" tags:"auth" summary:"logout"`
	LogoutInput
}

type RefreshInput added in v1.2.0

type RefreshInput struct {
	RefreshToken string `json:"refreshToken" v:"required"`
}

type RefreshOutput added in v1.2.0

type RefreshOutput struct {
	TokenType   string `json:"tokenType"`
	Token       string `json:"token"`
	ExpireIn    int64  `json:"expireIn"`
	ExpiresAt   string `json:"expiresAt"`
	Refreshable bool   `json:"refreshable"`
}

type RefreshReq added in v1.2.0

type RefreshReq struct {
	g.Meta `path:"/refresh" method:"post" tags:"auth" summary:"refresh once"`
	RefreshInput
}

type RefreshRes added in v1.2.0

type RefreshRes = RefreshOutput

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL