context

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	AuthToken                string   `policy:"true" json:"auth_token"`
	UserId                   string   `policy:"true" json:"user_id"`
	TenantId                 string   `policy:"true" json:"tenant_id"`
	DomainId                 string   `policy:"true" json:"domain_id"`
	UserDomainId             string   `policy:"true" json:"user_domain_id"`
	ProjectDomainId          string   `policy:"true" json:"project_domain_id"`
	IsAdmin                  bool     `policy:"true" json:"is_admin"`
	ReadOnly                 string   `policy:"true" json:"read_only"`
	ShowDeleted              string   `policy:"true" json:"show_deleted"`
	RequestId                string   `policy:"true" json:"request_id"`
	ResourceUuid             string   `policy:"true" json:"resource_uuid"`
	Overwrite                string   `policy:"true" json:"overwrite"`
	Roles                    []string `policy:"true" json:"roles"`
	UserName                 string   `policy:"true" json:"user_name"`
	ProjectName              string   `policy:"true" json:"project_name"`
	DomainName               string   `policy:"true" json:"domain_name"`
	UserDomainName           string   `policy:"true" json:"user_domain_name"`
	ProjectDomainName        string   `policy:"true" json:"project_domain_name"`
	IsAdminProject           bool     `policy:"true" json:"is_admin_project"`
	ServiceToken             string   `policy:"true" json:"service_token"`
	ServiceUserId            string   `policy:"true" json:"service_user_id"`
	ServiceUserName          string   `policy:"true" json:"service_user_name"`
	ServiceUserDomainId      string   `policy:"true" json:"service_user_domain_id"`
	ServiceUserDomainName    string   `policy:"true" json:"service_user_domain_name"`
	ServiceProjectId         string   `policy:"true" json:"service_project_id"`
	ServiceProjectName       string   `policy:"true" json:"service_project_name"`
	ServiceProjectDomainId   string   `policy:"true" json:"service_project_domain_id"`
	ServiceProjectDomainName string   `policy:"true" json:"service_project_domain_name"`
	ServiceRoles             string   `policy:"true" json:"service_roles"`
	Token                    string   `policy:"false" json:"token"`
	Uri                      string   `policy:"false" json:"uri"`
}

func GetContext

func GetContext(req *restful.Request) *Context

func NewAdminContext

func NewAdminContext() *Context

func NewContextFromJson

func NewContextFromJson(s string) *Context

func NewInternalTenantContext

func NewInternalTenantContext(tenantId, userId string) *Context

func UpdateContext

func UpdateContext(req *restful.Request, param map[string]interface{}) (*Context, error)

func (*Context) ToJson

func (ctx *Context) ToJson() string

func (*Context) ToPolicyValue

func (ctx *Context) ToPolicyValue() map[string]interface{}

Jump to

Keyboard shortcuts

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