service

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCreatorIDFromContext

func GetCreatorIDFromContext(ctx context.Context) (string, bool)

GetCreatorIDFromContext はContextからセッション作成者のIDを取得します。

func GetTokenFromContext

func GetTokenFromContext(ctx context.Context) (*oauth2.Token, bool)

GetTokenFromContext はContextからトークンを取得します。

func GetUserIDFromContext

func GetUserIDFromContext(ctx context.Context) (string, bool)

GetUserIDFromContext はContextからユーザIDを取得します。

func NewBackgroundContextFromContext added in v1.4.1

func NewBackgroundContextFromContext(prevCtx context.Context) context.Context

NewContextFromContext は既存のContextに含まれるトークンなどをコピーした上で、新しいContextを生成します。 これは、goroutine内のループなど、HTTPリクエスト終了後も生き残って欲しいContextを作るのに使われます。

func SetCreatorIDToContext

func SetCreatorIDToContext(ctx context.Context, userID string) context.Context

SetCreatorIDToContext はセッション作成者のIDをContextにセットします。

func SetTokenToContext

func SetTokenToContext(ctx context.Context, token *oauth2.Token) context.Context

SetTokenToContext はトークンをContextにセットします。

func SetUserIDToContext

func SetUserIDToContext(ctx context.Context, userID string) context.Context

SetUserIDToContext はユーザIDをContextにセットします。

Types

type ContextKey

type ContextKey string

ContextKey はContextに情報を保存するときのキーです。

Jump to

Keyboard shortcuts

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