envconfig

package
v1.8.8 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddOnTokenConfigPathEnv     = "ALIYUN_LOG_ADDON_TOKEN_PATH" //nolint:gosec
	DefaultAddOnTokenConfigPath = "/var/addon/token-config"     //nolint:gosec
)
View Source
const (
	QueryMode                          string = "query"
	StandardMode                       string = "standard"
	NoneTelemetryType                  string = "None"
	MetricsTelemetryType               string = "Metrics"
	TagLogtailConfig                   string = "logtailconfig"
	TagMachinegroup                    string = "machinegroup"
	SlsLogtailChannalKey               string = "sls.logtail.channel"
	SlsLogtailChannalEnv               string = "ENV"
	SlsMachinegroupDeployModeKey       string = "sls.machinegroup.deploy_mode"
	SlsMachinegroupDeployModeDeamonset string = "deamonset"
)

Variables

This section is empty.

Functions

func CreateProductLogstore

func CreateProductLogstore(region, project, logstore, product, lang string, hotTTL int) error

CreateProductLogstore create product logstore

"cn-hangzhou"
"test-hangzhou-project"
"audit-logstore"
"k8s-audit"
"cn"

func GetAnnotationByError added in v1.1.2

func GetAnnotationByError(projectInfo map[string]string, customError *CustomError) map[string]string

func GetAnnotationByObject added in v1.1.2

func GetAnnotationByObject(config *AliyunLogConfigSpec, project, logstore, product, configName string, rawConfig bool) map[string]string

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

func UpdateTokenFunction

func UpdateTokenFunction() (accessKeyID, accessKeySecret, securityToken string, expireTime time.Time, err error)

Types

type AKInfo

type AKInfo struct {
	AccessKeyID     string `json:"access.key.id"`
	AccessKeySecret string `json:"access.key.secret"`
	SecurityToken   string `json:"security.token"`
	Expiration      string `json:"expiration"`
	Keyring         string `json:"keyring"`
}

AKInfo ...

type AliyunLogConfigDetail

type AliyunLogConfigDetail struct {
	ConfigName    string                 `json:"configName"`
	InputType     string                 `json:"inputType"`
	LogtailConfig map[string]interface{} `json:"inputDetail"`
}

AliyunLogConfigDetail logtail config detail

func (*AliyunLogConfigDetail) InitFromDockerInfo

func (alcs *AliyunLogConfigDetail) InitFromDockerInfo(dockerInfo *helper.DockerInfoDetail,
	config string,
	configKeys []string,
	configValues []string) error

InitFromDockerInfo init AliyunLogConfigDetail from docker info with specific config name

type AliyunLogConfigSpec

type AliyunLogConfigSpec struct {
	Project                string                `json:"project"`
	Logstore               string                `json:"logstore"`
	ShardCount             *int32                `json:"shardCount"`
	LifeCycle              *int32                `json:"lifeCycle"`
	MachineGroups          []string              `json:"machineGroups"`
	LogtailConfig          AliyunLogConfigDetail `json:"logtailConfig"`
	ContainerName          string                `json:"containerName"`
	HashCode               []byte                `json:"hashCode"`
	ErrorCount             int                   `json:"errorCount"`
	NextTryTime            int64                 `json:"nextTryTime"`
	SimpleConfig           bool                  `json:"simpleConfig"`
	LastFetchTime          int64                 `json:"lastFetchTime"`
	ProductCode            string                `json:"productCode"`
	ProductLang            string                `json:"productLang"`
	LogstoreMode           string                `json:"logstoreMode"`
	LogstoreHotTTL         *int32                `json:"logstoreHotTTL"`
	LogstoreTelemetryType  string                `json:"logstoreTelemetryType"`
	LogstoreAppendMeta     bool                  `json:"logstoreAppendMeta"`
	LogstoreMaxSplitShard  *int32                `json:"logstoreMaxSplitShard"`
	LogstoreEnableTracking bool                  `json:"logstoreEnableTracking"`
	LogstoreAutoSplit      bool                  `json:"logstoreAutoSplit"`
	LogstoreEncryptConf    aliyunlog.EncryptConf `json:"logstoreEncryptConf"`
	ConfigTags             map[string]string     `json:"configTags"`
}

AliyunLogConfigSpec logtail config struct for wrapper

func (*AliyunLogConfigSpec) Key

func (alcs *AliyunLogConfigSpec) Key() string

Key return the unique key

type CustomError added in v1.1.2

type CustomError struct {
	Code      string
	RequestID string
	Message   string
	RawError  error
}

func CustomErrorFromPopError added in v1.1.2

func CustomErrorFromPopError(popError error) *CustomError

func CustomErrorFromSlsSDKError added in v1.1.2

func CustomErrorFromSlsSDKError(slsSDKError error) *CustomError

func CustomErrorNew added in v1.1.2

func CustomErrorNew(code string, requestID string, msg string) *CustomError

func (*CustomError) CustomError added in v1.1.2

func (e *CustomError) CustomError() string

type Manager

type Manager struct {
	AllConfigMap map[string]*AliyunLogConfigSpec
	// contains filtered or unexported fields
}

type SDKError added in v1.1.2

type SDKError struct {
	HTTPCode     int    `json:"httpCode"`
	ErrorCode    string `json:"errorCode"`
	ErrorMessage string `json:"errorMessage"`
	RequestID    string `json:"requestID"`
}

type SecurityTokenResult

type SecurityTokenResult struct {
	AccessKeyID     string
	AccessKeySecret string
	Expiration      string
	SecurityToken   string
	Code            string
	LastUpdated     string
}

Jump to

Keyboard shortcuts

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