global_model

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseClient added in v1.4.0

func CloseClient(stage *kk_stage.Stage)

CloseClient reset etcd client after request

func GetAuthorizationToken

func GetAuthorizationToken(stage *kk_stage.Stage) string

GetAuthorizationToken get AuthorizationToken from globalHeader

func GetClient added in v1.4.0

func GetClient(stage *kk_stage.Stage) *clientv3.Client

GetClient get etcd client

func GetLoginUser

func GetLoginUser(stage *kk_stage.Stage) *kk_etcd_models.PBUser

GetLoginUser get current login user from gin context

func SetClient added in v1.4.0

func SetClient(stage *kk_stage.Stage, client *clientv3.Client)

SetClient set etcd client

func SetLoginUser

func SetLoginUser(stage *kk_stage.Stage, user *kk_etcd_models.PBUser)

SetLoginUser set current login user to gin context

func SetRequestHeader

func SetRequestHeader(stage *kk_stage.Stage, header RequestHeader)

SetRequestHeader set current request header to gin context

Types

type RequestHeader

type RequestHeader struct {
	UserName           string //delete after todo use https://github.com/etcd-io/etcd/pull/16803
	Password           string //delete after
	AuthorizationToken string
}

func GetRequestHeader

func GetRequestHeader(stage *kk_stage.Stage) RequestHeader

GetRequestHeader get current request header from gin context

Jump to

Keyboard shortcuts

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