Documentation ¶
Index ¶
- Constants
- type Auth
- type AuthBody
- type AuthPlugin
- type Catalog
- type Domain
- type Endpoint
- type Identity
- type Password
- type PasswordAuthPlugin
- func (plugin PasswordAuthPlugin) AuthRequest(req *resty.Request) error
- func (plugin PasswordAuthPlugin) GetProjectId() (string, error)
- func (plugin PasswordAuthPlugin) GetSafeHeader(header http.Header) http.Header
- func (plugin *PasswordAuthPlugin) GetServiceEndpoint(serviceType string, serviceName string, serviceInterface string) (string, error)
- func (plugin PasswordAuthPlugin) GetToken() (*Token, error)
- func (plugin *PasswordAuthPlugin) GetTokenId() (string, error)
- func (plugin PasswordAuthPlugin) IsAdmin() bool
- func (plugin PasswordAuthPlugin) Region() string
- func (plugin PasswordAuthPlugin) SetHttpTimeout(timeout int) *PasswordAuthPlugin
- func (plugin *PasswordAuthPlugin) SetLocalTokenExpire(expireSeconds int)
- func (plugin *PasswordAuthPlugin) TokenIssue() error
- type Project
- type RespToken
- type Role
- type Scope
- type Token
- type TokenCache
- type User
Constants ¶
View Source
const ( CONTENT_TYPE string = "application/json" TYPE_COMPUTE string = "compute" TYPE_VOLUME string = "volume" TYPE_VOLUME_V2 string = "volumev2" TYPE_VOLUME_V3 string = "volumev3" TYPE_IDENTITY string = "identity" TYPE_IMAGE string = "image" TYPE_NETWORK string = "network" INTERFACE_PUBLIC string = "public" INTERFACE_ADMIN string = "admin" INTERFACE_INTERVAL string = "internal" URL_AUTH_TOKEN string = "/auth/tokens" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthPlugin ¶
type AuthPlugin interface { GetToken() (*Token, error) GetTokenId() (string, error) SetLocalTokenExpire(expire int) GetServiceEndpoint(sType string, sName string, sInterface string) (string, error) TokenIssue() error Region() string AuthRequest(req *resty.Request) error GetSafeHeader(header http.Header) http.Header GetProjectId() (string, error) IsAdmin() bool }
type PasswordAuthPlugin ¶
type PasswordAuthPlugin struct { AuthUrl string Username string Password string ProjectName string UserDomainName string ProjectDomainName string RegionName string LocalTokenExpireSecond int // contains filtered or unexported fields }
func NewPasswordAuth ¶
func NewPasswordAuth(authUrl string, user User, project Project, regionName string) *PasswordAuthPlugin
func (PasswordAuthPlugin) AuthRequest ¶
func (plugin PasswordAuthPlugin) AuthRequest(req *resty.Request) error
func (PasswordAuthPlugin) GetProjectId ¶
func (plugin PasswordAuthPlugin) GetProjectId() (string, error)
func (PasswordAuthPlugin) GetSafeHeader ¶
func (plugin PasswordAuthPlugin) GetSafeHeader(header http.Header) http.Header
func (*PasswordAuthPlugin) GetServiceEndpoint ¶
func (PasswordAuthPlugin) GetToken ¶
func (plugin PasswordAuthPlugin) GetToken() (*Token, error)
func (*PasswordAuthPlugin) GetTokenId ¶
func (plugin *PasswordAuthPlugin) GetTokenId() (string, error)
func (PasswordAuthPlugin) IsAdmin ¶
func (plugin PasswordAuthPlugin) IsAdmin() bool
func (PasswordAuthPlugin) Region ¶
func (plugin PasswordAuthPlugin) Region() string
func (PasswordAuthPlugin) SetHttpTimeout ¶
func (plugin PasswordAuthPlugin) SetHttpTimeout(timeout int) *PasswordAuthPlugin
func (*PasswordAuthPlugin) SetLocalTokenExpire ¶
func (plugin *PasswordAuthPlugin) SetLocalTokenExpire(expireSeconds int)
func (*PasswordAuthPlugin) TokenIssue ¶
func (plugin *PasswordAuthPlugin) TokenIssue() error
type Project ¶
type Project struct { Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` Domain Domain `json:"domain,omitempty"` Description string `json:"description,omitempty"` Enabled bool `json:"enabled,omitempty"` DomainId string `json:"domain_id,omitempty"` Tags []string `json:"tags,omitempty"` IsDomain bool `json:"is_domain,omitempty"` ParentId string `json:"parent_id,omitempty"` }
type TokenCache ¶
type TokenCache struct { TokenId string // contains filtered or unexported fields }
func (*TokenCache) GetServiceEndpoints ¶
func (tc *TokenCache) GetServiceEndpoints(serviceType string, serviceName string) []Endpoint
func (*TokenCache) IsTokenExpired ¶
func (tc *TokenCache) IsTokenExpired() bool
type User ¶
type User struct { Id string `json:"id,omitempty"` Name string `json:"name"` Password string `json:"password"` Project string `json:"project,omitempty"` Description string `json:"description,omitempty"` Email string `json:"email,omitempty"` Enabled bool `json:"enabled,omitempty"` Domain Domain `json:"domain"` DomainId string `json:"domain_id,omitempty"` }
Click to show internal directories.
Click to hide internal directories.