config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

This code serves as an example and is not meant for production use.

Copyright 2020 Veeva Systems Inc.

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

View Source
const (
	Size5MB           = 5 * 1024 * 1024
	Size50MB          = 50 * 1024 * 1024
	JobTimeoutSeconds = 60
)
View Source
const (
	ConfigKeyDomainName   = "domain_name"
	ConfigKeyAPIVersion   = "api_version"
	ConfigKeyUsername     = "username"
	ConfigKeyPassword     = "password"
	ConfigAuthResult      = "auth_result"
	ConfigUploadSessionID = "upload_session_id"
	ConfigActiveJobIDs    = "active_jobs"
)

Variables

View Source
var EnableDebug bool

Functions

func APIVersion

func APIVersion() string

APIVersion - return api version from configuration

func ActiveJobs

func ActiveJobs() map[string]string

ActiveJobs - return list of active jobs

func AuthResult

func AuthResult() *model.AuthResult

AuthResult - return auth result from configuration

func DomainName

func DomainName() string

DomainName - return domain name from configuration

func InitConfig

func InitConfig()

InitConfig reads in config file and ENV variables if set.

func Password

func Password() string

Password - return password from configuration

func RemoveActiveJob

func RemoveActiveJob(jobID string)

RemoveActiveJob - remove and update list of active jobs in the configuration

func ResetAuthResult

func ResetAuthResult()

ResetAuthResult - clear authentication information

func ResetConfig

func ResetConfig()

ResetConfig - reset the configuration

func SetAuthResult added in v0.0.3

func SetAuthResult(result *model.AuthResult)

SetAuthResult - Save auth result in the configuration

func SetPassword

func SetPassword(password string)

SetPassword - store password in the configuration

func SetUploadSessionID added in v0.0.3

func SetUploadSessionID(sessionID string)

SetUploadSessionID - Store upload session id in the configuration

func UpdateActiveJob

func UpdateActiveJob(jobID, status string)

UpdateActiveJob - update list of active jobs in the configuration

func UpdateConfig

func UpdateConfig()

UpdateConfig - update configuration

func UploadSessionID

func UploadSessionID() string

UploadSessionID - return upload session id from configuration

func Username

func Username() string

Username - return username from configuration

Types

This section is empty.

Jump to

Keyboard shortcuts

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