service

package
v0.0.0-...-194264a Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2018 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const PrivKey key = 0

PrivKey is the index of the context map which indicates whether a service API has been called by a privileged user or not.

View Source
const TenantIDKey key = 1

TenantIDKey is the index of the context map which indicates the tenant id which is being used in the API call

Variables

This section is empty.

Functions

func GetPrivilege

func GetPrivilege(ctx context.Context) bool

GetPrivilege returns the value of PrivKey

func GetTenantID

func GetTenantID(ctx context.Context) (string, error)

GetTenantID returns the value of TenantIDKey

func SetPrivilege

func SetPrivilege(ctx context.Context, privileged bool) context.Context

SetPrivilege is used to set the value of PrivKey

func SetTenantID

func SetTenantID(ctx context.Context, tenantID string) context.Context

SetTenantID sets the value of Tenant ID

Types

This section is empty.

Jump to

Keyboard shortcuts

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