utils

package
v0.0.0-...-63046b2 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateId

func CreateId(title string) (string, error)

func GetSessonToken

func GetSessonToken(
	ctx context.Context,
	client client.Client,
	w http.ResponseWriter,
	r *http.Request,
	tokenManageName string,
	apiUrl string,
	handlePath string) (string, error)

Get session token. If the session token is invalid (expired), redirect to /account/update to update the session token.

Arguments:

ctx {context.Context} - context.
client {client.Client} - Dapr client.
w {http.ResponseWriter} - http writer.
r {*http.Request} - http requests.
tokenManageName {string} - Dapr app name of token verify.
apiUrl {string} - Domain of this API.
handlePath {string} - Path of this API.

Returns:

{string} - User id.

func VerifySessionToken

func VerifySessionToken(ctx context.Context, daprClient client.Client, token string, tokenManagerName string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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