Documentation ¶
Index ¶
- Constants
- type Auth
- type AuthBody
- type Catalog
- type Domain
- type Endpoint
- type Identity
- type Password
- type PasswordAuthPlugin
- func (plugin *PasswordAuthPlugin) Delete(url string, headers map[string]string) (*common.Response, error)
- func (plugin *PasswordAuthPlugin) Get(url string, query url.Values, headers map[string]string) (*common.Response, error)
- func (plugin *PasswordAuthPlugin) GetAuthTokenId() string
- 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) Post(url string, body []byte, headers map[string]string) (*common.Response, error)
- func (plugin *PasswordAuthPlugin) Put(url string, body []byte, headers map[string]string) (*common.Response, error)
- func (plugin *PasswordAuthPlugin) Request(req *http.Request) (*common.Response, error)
- func (plugin *PasswordAuthPlugin) SetHttpTimeout(timeout int)
- func (plugin *PasswordAuthPlugin) SetTokenExpireSecond(expire int)
- func (plugin *PasswordAuthPlugin) TokenIssue() error
- type Project
- type RespToken
- 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 PasswordAuthPlugin ¶
type PasswordAuthPlugin struct { AuthUrl string Username string Password string ProjectName string UserDomainName string ProjectDomainName string RegionName string TokenExpireSecond int // contains filtered or unexported fields }
func NewPasswordAuth ¶
func NewPasswordAuth(authUrl string, user User, project Project, regionName string) PasswordAuthPlugin
func (*PasswordAuthPlugin) GetAuthTokenId ¶
func (plugin *PasswordAuthPlugin) GetAuthTokenId() string
func (*PasswordAuthPlugin) GetServiceEndpoint ¶
func (PasswordAuthPlugin) GetToken ¶
func (plugin PasswordAuthPlugin) GetToken() (*Token, error)
func (*PasswordAuthPlugin) GetTokenId ¶
func (plugin *PasswordAuthPlugin) GetTokenId() (string, error)
func (*PasswordAuthPlugin) SetHttpTimeout ¶
func (plugin *PasswordAuthPlugin) SetHttpTimeout(timeout int)
func (*PasswordAuthPlugin) SetTokenExpireSecond ¶
func (plugin *PasswordAuthPlugin) SetTokenExpireSecond(expire int)
func (*PasswordAuthPlugin) TokenIssue ¶
func (plugin *PasswordAuthPlugin) TokenIssue() error
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.