http

package
v0.5.11-0...-f959136 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Copyright © 2022 Doppler <support@doppler.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2019 Doppler <support@doppler.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2019 Doppler <support@doppler.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2019 Doppler <support@doppler.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2019 Doppler <support@doppler.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var DNSResolverAddress = "1.1.1.1:53"
View Source
var DNSResolverProto = "udp"
View Source
var DNSResolverTimeout = time.Duration(5) * time.Second
View Source
var RequestAttempts = 5

RequestAttempts how many request attempts are made before giving up

View Source
var TimeoutDuration = 10 * time.Second

TimeoutDuration how long to wait for a request to complete before timing out

View Source
var UseCustomDNSResolver = false

DNS resolver

View Source
var UseTimeout = true

UseTimeout whether to timeout long-running requests

Functions

func DeleteRequest

func DeleteRequest(url *url.URL, verifyTLS bool, headers map[string]string, body []byte) (int, http.Header, []byte, error)

DeleteRequest perform HTTP DELETE

func GetLatestCLIVersion

func GetLatestCLIVersion() (models.VersionCheck, error)

GetLatestCLIVersion fetches the latest CLI version

func GetRequest

func GetRequest(url *url.URL, verifyTLS bool, headers map[string]string) (int, http.Header, []byte, error)

GetRequest perform HTTP GET

func IsRetry

func IsRetry(statusCode int, contentType string) bool

func PostRequest

func PostRequest(url *url.URL, verifyTLS bool, headers map[string]string, body []byte) (int, http.Header, []byte, error)

PostRequest perform HTTP POST

func PutRequest

func PutRequest(url *url.URL, verifyTLS bool, headers map[string]string, body []byte) (int, http.Header, []byte, error)

PutRequest perform HTTP PUT

Types

type Error

type Error struct {
	Err     error
	Message string
	Code    int
}

Error API errors

func CaptureCommand

func CaptureCommand(command string) ([]byte, Error)

func CaptureEvent

func CaptureEvent(event string, metadata map[string]interface{}) ([]byte, Error)

func CloneConfig

func CloneConfig(host string, verifyTLS bool, apiKey string, project string, config string, name string) (models.ConfigInfo, Error)

CloneConfig clone a config

func CreateConfig

func CreateConfig(host string, verifyTLS bool, apiKey string, project string, name string, environment string) (models.ConfigInfo, Error)

CreateConfig create a config

func CreateConfigServiceToken

func CreateConfigServiceToken(host string, verifyTLS bool, apiKey string, project string, config string, name string, expireAt time.Time, access string) (models.ConfigServiceToken, Error)

CreateConfigServiceToken create a config service token

func CreateEnvironment

func CreateEnvironment(host string, verifyTLS bool, apiKey string, project string, name string, slug string) (models.EnvironmentInfo, Error)

CreateEnvironment create an environment

func CreateProject

func CreateProject(host string, verifyTLS bool, apiKey string, name string, description string) (models.ProjectInfo, Error)

CreateProject create a project

func DeleteConfig

func DeleteConfig(host string, verifyTLS bool, apiKey string, project string, config string) Error

DeleteConfig delete a config

func DeleteConfigServiceToken

func DeleteConfigServiceToken(host string, verifyTLS bool, apiKey string, project string, config string, slug string, token string) Error

DeleteConfigServiceToken delete a config service token

func DeleteEnvironment

func DeleteEnvironment(host string, verifyTLS bool, apiKey string, project string, environment string) Error

DeleteEnvironment delete an environment

func DeleteProject

func DeleteProject(host string, verifyTLS bool, apiKey string, project string) Error

DeleteProject delete a project

func DownloadSecrets

func DownloadSecrets(host string, verifyTLS bool, apiKey string, project string, config string, format models.SecretsFormat, nameTransformer *models.SecretsNameTransformer, etag string, dynamicSecretsTTL time.Duration, secrets []string) (int, http.Header, []byte, Error)

DownloadSecrets for specified project and config

func GenerateAuthCode

func GenerateAuthCode(host string, verifyTLS bool, hostname string, os string, arch string) (map[string]interface{}, Error)

GenerateAuthCode generate an auth code

func GetActivityLog

func GetActivityLog(host string, verifyTLS bool, apiKey string, log string) (models.ActivityLog, Error)

GetActivityLog get specified activity log

func GetActivityLogs

func GetActivityLogs(host string, verifyTLS bool, apiKey string, page int, number int) ([]models.ActivityLog, Error)

GetActivityLogs get activity logs

func GetActorInfo

func GetActorInfo(host string, verifyTLS bool, apiKey string) (models.ActorInfo, Error)

func GetAuthToken

func GetAuthToken(host string, verifyTLS bool, code string) (map[string]interface{}, Error)

GetAuthToken get an auth token

func GetCLIInstallScript

func GetCLIInstallScript() ([]byte, Error)

GetCLIInstallScript from cli.doppler.com

func GetChangelog

func GetChangelog() ([]byte, Error)

GetChangelog of CLI releases

func GetConfig

func GetConfig(host string, verifyTLS bool, apiKey string, project string, config string) (models.ConfigInfo, Error)

GetConfig get a config

func GetConfigLog

func GetConfigLog(host string, verifyTLS bool, apiKey string, project string, config string, log string) (models.ConfigLog, Error)

GetConfigLog get config audit log

func GetConfigLogs

func GetConfigLogs(host string, verifyTLS bool, apiKey string, project string, config string, page int, number int) ([]models.ConfigLog, Error)

GetConfigLogs get config audit logs

func GetConfigServiceTokens

func GetConfigServiceTokens(host string, verifyTLS bool, apiKey string, project string, config string) ([]models.ConfigServiceToken, Error)

GetConfigServiceTokens get config service tokens

func GetConfigs

func GetConfigs(host string, verifyTLS bool, apiKey string, project string, environment string, page int, number int) ([]models.ConfigInfo, Error)

GetConfigs get configs

func GetEnvironment

func GetEnvironment(host string, verifyTLS bool, apiKey string, project string, environment string) (models.EnvironmentInfo, Error)

GetEnvironment get specified environment

func GetEnvironments

func GetEnvironments(host string, verifyTLS bool, apiKey string, project string, page int, number int) ([]models.EnvironmentInfo, Error)

GetEnvironments get environments

func GetProject

func GetProject(host string, verifyTLS bool, apiKey string, project string) (models.ProjectInfo, Error)

GetProject get specified project

func GetProjects

func GetProjects(host string, verifyTLS bool, apiKey string, page int, number int) ([]models.ProjectInfo, Error)

GetProjects get projects

func GetSecretNames

func GetSecretNames(host string, verifyTLS bool, apiKey string, project string, config string, includeDynamicSecrets bool) ([]string, Error)

GetSecretNames for specified project and config

func GetSecrets

func GetSecrets(host string, verifyTLS bool, apiKey string, project string, config string, secrets []string, includeDynamicSecrets bool, dynamicSecretsTTL time.Duration) ([]byte, Error)

GetSecrets for specified project and config

func GetWorkplaceSettings

func GetWorkplaceSettings(host string, verifyTLS bool, apiKey string) (models.WorkplaceSettings, Error)

GetWorkplaceSettings get specified workplace settings

func ImportTemplate

func ImportTemplate(host string, verifyTLS bool, apiKey string, template []byte) ([]models.ProjectInfo, Error)

ImportTemplate import projects from a template file

func InitiateMfaRecovery

func InitiateMfaRecovery(host string, verifyTLS bool, apiKey string) Error

func LockConfig

func LockConfig(host string, verifyTLS bool, apiKey string, project string, config string) (models.ConfigInfo, Error)

LockConfig lock a config

func RenameEnvironment

func RenameEnvironment(host string, verifyTLS bool, apiKey string, project string, environment string, name string, slug string) (models.EnvironmentInfo, Error)

RenameEnvironment rename an environment

func RevokeAuthToken

func RevokeAuthToken(host string, verifyTLS bool, token string) (map[string]interface{}, Error)

RevokeAuthToken revoke an auth token

func RollAuthToken

func RollAuthToken(host string, verifyTLS bool, token string) (map[string]interface{}, Error)

RollAuthToken roll an auth token

func RollbackConfigLog

func RollbackConfigLog(host string, verifyTLS bool, apiKey string, project string, config string, log string) (models.ConfigLog, Error)

RollbackConfigLog rollback a config log

func SetSecretNoteViaConfig

func SetSecretNoteViaConfig(host string, verifyTLS bool, apiKey string, project string, config string, secret string, note string) (models.SecretNote, Error)

Set Secret Note for specified project and config This is deprecated in favor of SetSecretNoteViaProject

func SetSecretNoteViaProject

func SetSecretNoteViaProject(host string, verifyTLS bool, apiKey string, project string, secret string, note string) (models.SecretNote, Error)

Set Secret Note for specified project

func SetSecrets

func SetSecrets(host string, verifyTLS bool, apiKey string, project string, config string, secrets map[string]interface{}, changeRequests []models.ChangeRequest) (map[string]models.ComputedSecret, Error)

SetSecrets for specified project and config

func SetWorkplaceSettings

func SetWorkplaceSettings(host string, verifyTLS bool, apiKey string, values models.WorkplaceSettings) (models.WorkplaceSettings, Error)

SetWorkplaceSettings set workplace settings

func UnlockConfig

func UnlockConfig(host string, verifyTLS bool, apiKey string, project string, config string) (models.ConfigInfo, Error)

UnlockConfig unlock a config

func UpdateConfig

func UpdateConfig(host string, verifyTLS bool, apiKey string, project string, config string, name string) (models.ConfigInfo, Error)

UpdateConfig update a config

func UpdateProject

func UpdateProject(host string, verifyTLS bool, apiKey string, project string, name string, description ...string) (models.ProjectInfo, Error)

UpdateProject update a project's name and (optional) description

func UploadSecrets

func UploadSecrets(host string, verifyTLS bool, apiKey string, project string, config string, secrets string) (map[string]models.ComputedSecret, Error)

UploadSecrets for specified project and config

func WatchSecrets

func WatchSecrets(host string, verifyTLS bool, apiKey string, project string, config string, handler func([]byte)) (int, http.Header, Error)

WatchSecrets for any changes

func (*Error) IsNil

func (e *Error) IsNil() bool

IsNil whether the error is nil

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap get the original error

Jump to

Keyboard shortcuts

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