config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 5

Documentation

Overview

github.com/whatap/go-api/config

Index

Constants

This section is empty.

Variables

View Source
var AppType int16 = 3

Functions

func GetWhatapHome

func GetWhatapHome() string

Types

type ConfGo

type ConfGo struct {
	GoSqlProfileEnabled bool
	GoCounterEnabled    bool
	GoCounterInterval   int32
	GoCounterTimeout    int32
}

func (*ConfGo) Apply

func (this *ConfGo) Apply(conf *Config)

func (*ConfGo) ApplyDefault

func (this *ConfGo) ApplyDefault(m map[string]string)

type ConfGoGrpc

type ConfGoGrpc struct {
	GoGrpcProfileEnabled             bool
	GoGrpcProfileStreamClientEnabled bool
	GoGrpcProfileStreamServerEnabled bool
	GoGrpcProfileIgnoreMethod        []string
	GoGrpcProfileStreamMethod        []string
	GoGrpcProfileStreamIdentify      bool
	GoGrpcProfileStreamRate          int32
}

func (*ConfGoGrpc) Apply

func (this *ConfGoGrpc) Apply(conf *Config)

func (*ConfGoGrpc) ApplyDefault

func (this *ConfGoGrpc) ApplyDefault(m map[string]string)

type ConfLogSink added in v0.1.12

type ConfLogSink struct {
	WatchLogEnabled       bool
	WatchLogCheckInterval int64

	WatchLogReadCount  int32
	WatchLogBufferSize int32
	WatchLogLineSize   int32
	WatchLogSendCount  int32

	LogSinkEnabled bool

	LogSinkQueueSize      int32
	DebugLogSinkEnabled   bool
	LogSinkLineSize       int32
	DebugLogSinkLineLimit int32
	LogSinkZipEnabled     bool
	LogSinkFiles          []string
	LogSinkInterval       int32

	MaxBufferSize          int32
	MaxWaitTime            int32
	LogSinkZipMinSize      int32
	DebugLogSinkZipEnabled bool
	LogSinkZipLibpath      string
}

func (*ConfLogSink) Apply added in v0.1.12

func (this *ConfLogSink) Apply(conf *Config)

type ConfNet added in v0.1.12

type ConfNet struct {
	License string

	PCODE      int64
	OID        int64
	ONAME      string
	OKIND      int32
	OKIND_NAME string
	ONODE      int32
	ONODE_NAME string

	WhatapHost []string
	WhatapPort int32
	Hosts      []string
}

func (*ConfNet) Apply added in v0.1.12

func (this *ConfNet) Apply(conf *Config)

func (*ConfNet) ApplyDefault added in v0.1.12

func (this *ConfNet) ApplyDefault(m map[string]string)

type Config

type Config struct {
	PCODE      int64
	OID        int64
	OKIND      int32
	OKIND_NAME string
	ONODE      int32
	ONODE_NAME string

	AppType int16 // private
	Enabled bool

	NetUdpHost string
	NetUdpPort int32

	TransactionEnabled bool
	//profile
	ProfileSqlParamEnabled    bool
	ProfileSqlCommentEnabled  bool
	ProfileSqlResourceEnabled bool

	ProfileMethodEnabled      bool
	ProfileMethodStackEnabled bool

	ProfileHttpHeaderEnabled   bool   // 수집 유무(HTTP-HEADERS)
	ProfileHttpHeaderUrlPrefix string // 수집 url prefix

	ProfileHttpParameterEnabled   bool   // 수집 유무(HTTP-PARAMETERS)
	ProfileHttpParameterUrlPrefix string // 수집 url prefix

	TraceUserEnabled             bool // TODO:  UseridUtil으로 기본값인 whatap cookie설정 해야함.
	TraceUserUsingIp             bool
	TraceUserHeaderTicket        string // TODO: UseridUtil
	TraceUserHeaderTicketEnabled bool   // private
	TraceUserSetCookie           bool
	TraceUserCookieLimit         int32
	TraceUserCookieKeys          []string // 세션 쿠키 키 이름 별로도 지정.
	TraceUserUsingType           int32    // private

	TraceHttpClientIpHeaderKeyEnabled bool
	TraceHttpClientIpHeaderKey        string // TODO: getRemoteAddr

	MtraceEnabled        bool
	MtraceRate           int32
	TraceMtraceCallerKey string
	TraceMtraceCalleeKey string
	TraceMtraceInfoKey   string
	TraceMtracePoidKey   string
	TraceMtraceSpecKey   string
	TraceMtraceSpecKey1  string

	MtraceSendUrlLength int32
	MtraceSpec          string
	MtraceSpecHash      int32

	TxMaxCount          int32
	TxDefaultCapacity   int32
	TxDefaultLoadFactor float32

	Debug bool

	ConfGo
	ConfGoGrpc
	// contains filtered or unexported fields
}

func GetConfig

func GetConfig() *Config

func (*Config) ApplyConfig

func (conf *Config) ApplyConfig(m map[string]string)
	conf.ConfGo.ApplyDefault(m)
	conf.ConfGoGrpc.ApplyDefault(m)
	conf.ApplyConfig(m)
}

func (*Config) GetBoolean

func (conf *Config) GetBoolean(key string, def bool) bool

func (*Config) GetFloat added in v0.1.11

func (conf *Config) GetFloat(key string, def float32) float32

func (*Config) GetInt

func (conf *Config) GetInt(key string, def int) int32

func (*Config) GetIntSet

func (conf *Config) GetIntSet(key, defaultValue, deli string) []int32

func (*Config) GetLong

func (conf *Config) GetLong(key string, def int64) int64

func (*Config) GetStringArray

func (conf *Config) GetStringArray(key string, deli string) []string

func (*Config) GetStringHashCodeSet

func (conf *Config) GetStringHashCodeSet(key, defaultValue, deli string) []int32

func (*Config) GetStringHashSet

func (conf *Config) GetStringHashSet(key, defaultValue, deli string) []int32

func (*Config) GetValue

func (conf *Config) GetValue(key string) string

func (*Config) GetValueDef

func (conf *Config) GetValueDef(key, def string) string

func (*Config) InArray

func (conf *Config) InArray(str string, list []string) bool

func (*Config) String

func (conf *Config) String() string

func (*Config) ToString

func (conf *Config) ToString() string

type ConfigInterface added in v0.1.9

type ConfigInterface interface {
	ApplyConfig(*Config)
}

Jump to

Keyboard shortcuts

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