auth

package module
v0.0.0-...-3670298 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Routes map[myrouter.RouteKey]func(w http.ResponseWriter, r *http.Request, ps common.QueryMap) = map[myrouter.RouteKey]func(w http.ResponseWriter, r *http.Request, ps common.QueryMap){
	{Path: "/api/v1/auth/token", Method: "POST", NeedAuth: false}: uc.post,
}

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	Jwt       string `json:"jwt"`
	ExpiresAt int64  `json:"expires_at"`
}

type AuthRepository

type AuthRepository struct {
}

func (*AuthRepository) Find

func (r *AuthRepository) Find(ctx context.Context, id int, secret string) (*Client, error)

type AuthService

type AuthService struct {
	// contains filtered or unexported fields
}

func (*AuthService) Exist

func (s *AuthService) Exist(ctx context.Context, id int, secret string) (bool, error)

func (*AuthService) Find

func (s *AuthService) Find(ctx context.Context, id int, secret string) (*Client, error)

type Client

type Client struct {
	Id        int          `json:"id"`
	Secret    string       `json:"secret"`
	CreatedAt time.Time    `json:"createdat"`
	UpdatedAt sql.NullTime `json:"updatedat"`
}

func NewClient

func NewClient(
	id int,
	secret string,
	createdAt time.Time,
	updatedAt sql.NullTime,
) Client

type PostResponse

type PostResponse struct {
	*myhttp.ResponseBase
	AccessToken *AccessToken `json:"access_token"`
}

func NewPostResponse

func NewPostResponse(res *myhttp.ResponseBase, token *AccessToken) *PostResponse

Jump to

Keyboard shortcuts

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