Documentation ¶
Index ¶
Constants ¶
View Source
const ( RobotEmailSuffix = "@noreply.com" NeverExpire = "never" ExpiresAtFormat = "2006-01-02" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { CreateResourceAccessToken(ctx context.Context, request CreateResourceAccessTokenRequest, resourceType string, resourceID uint) (*CreateResourceAccessTokenResponse, error) CreatePersonalAccessToken(ctx context.Context, request CreatePersonalAccessTokenRequest) (*CreatePersonalAccessTokenResponse, error) ListPersonalAccessTokens(ctx context.Context, query *q.Query) (accessTokens []PersonalAccessToken, total int, err error) ListResourceAccessTokens(ctx context.Context, resourceType string, resourceID uint, query *q.Query) (accessTokens []ResourceAccessToken, total int, err error) RevokePersonalAccessToken(ctx context.Context, id uint) error RevokeResourceAccessToken(ctx context.Context, id uint) error }
func NewController ¶
func NewController(param *param.Param) Controller
type CreatePersonalAccessTokenResponse ¶
type CreatePersonalAccessTokenResponse struct { PersonalAccessToken Token string `json:"token"` }
type CreateResourceAccessTokenRequest ¶
type CreateResourceAccessTokenRequest struct { CreatePersonalAccessTokenRequest Role string `json:"role"` }
type CreateResourceAccessTokenResponse ¶
type CreateResourceAccessTokenResponse struct { ResourceAccessToken Token string `json:"token"` }
type PersonalAccessToken ¶
type PersonalAccessToken struct { CreatePersonalAccessTokenRequest ID uint `json:"id"` CreatedAt time.Time `json:"createdAt"` CreatedBy *usermodels.UserBasic `json:"createdBy"` }
type ResourceAccessToken ¶
type ResourceAccessToken struct { CreateResourceAccessTokenRequest ID uint `json:"id"` CreatedAt time.Time `json:"createdAt"` CreatedBy *usermodels.UserBasic `json:"createdBy"` }
Click to show internal directories.
Click to hide internal directories.