Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultClusterURL = "https://master.mesos"
)
Variables ¶
View Source
var (
ErrKeyEmpty = errors.New("Secret path cannot be empty")
)
View Source
var (
ErrNotImplemented = errors.New("API not implemented")
)
Functions ¶
func GenerateACSToken ¶
func GenerateACSToken(config TokenConfig) (string, error)
GenerateACSToken creates a new DC/OS token that can be used by API calls
func NewAPIError ¶
Types ¶
type Config ¶
type Config struct { // ClusterURL is the base URL of the DC/OS admin router. ClusterURL string // Insecure if true, indicates that the client does not verify server's // certificate chain. Not recommended as the connection could be susceptible to // man-in-the-middle attacks. When false, valid CACertFile should be provided. Insecure bool // CACertFile is the location of the root certificate authorities that clients // use when verifying server certificates. Not needed when Insecure flag is set. CACertFile string // ACSToken DC/OS authentication token used to authorize the API calls to the // admin router. Remember, that the DC/OS token expires after some time (five // days by default). So, it is recommended to refrest the token. Use the // GenerateACSToken() method to update the token at regular intervals or on // failure (401 Unauthorized). ACSToken string }
Config contains the options needed by the client to connect and authenticate
func NewDefaultConfig ¶
func NewDefaultConfig() Config
NewDefaultConfig has default options in the config, which can be overwritten
type CreateTokenRequest ¶
type CreateTokenRequest struct { UID string `json:"uid,omitempty"` Password string `json:"password,omitempty"` }
CreateTokenRequest request object to the create token API
type CreateTokenResponse ¶
type CreateTokenResponse struct {
Token string `json:"token,omitempty"`
}
CreateTokenResponse response object from the create token API
type DCOSSecrets ¶
type DCOSSecrets interface { UpdateACSToken(token string) GetSecret(store, key string) (*Secret, error) CreateSecret(store, key string, secret *Secret) error UpdateSecret(store, key string, secret *Secret) error CreateOrUpdateSecret(store, key string, secret *Secret) error DeleteSecret(store, key string) error RevokeSecret(store, key string) error RenewSecret(store, key string, duration int64) error }
func NewClient ¶
func NewClient(config Config) (DCOSSecrets, error)
type ErrorResponse ¶
type HTTPClient ¶
HTTPClient interface is used to mock the http.Client
type TokenConfig ¶
type TokenConfig struct { Config // Username username of the user who has access to the APIs. The Username // and Password are needed to generate the DC/OS ACS token. Username string // Password password of the user to generate the ACS token. Password string }
func DefaultTokenConfig ¶
func DefaultTokenConfig() TokenConfig
Click to show internal directories.
Click to hide internal directories.