config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cfg = &Config{}

Functions

This section is empty.

Types

type Application

type Application struct {
	Name       string            `yaml:"name" json:"name"`
	Mode       Mode              `yaml:"mode" json:"mode"`
	Origin     string            `yaml:"origin" json:"origin"`
	StaticPath map[string]string `yaml:"staticPath" json:"staticPath"`
}

func (*Application) Init

func (e *Application) Init(r gin.IRouter)

type Auth

type Auth struct {
	Realm       string        `yaml:"realm" json:"realm"`
	Key         string        `yaml:"key" json:"key"`
	IdentityKey string        `yaml:"identityKey" json:"identityKey"`
	Timeout     time.Duration `yaml:"timeout" json:"timeout"`
	MaxRefresh  time.Duration `yaml:"maxRefresh" json:"maxRefresh"`
}

type Config

type Config struct {
	Auth        Auth            `yaml:"auth" json:"auth"`
	GRPC        config.GRPC     `yaml:"grpc" json:"grpc"`
	Logger      config.Logger   `yaml:"logger" json:"logger"`
	Server      config.Listen   `yaml:"server" json:"server"`
	Listen      *config.Listen  `yaml:"listen" json:"listen"`
	Database    gormdb.Database `yaml:"database" json:"database"`
	Application Application     `yaml:"application" json:"application"`
	OAuth2      *config.OAuth2  `yaml:"oauth2" json:"oauth2"`
	Task        Task            `yaml:"task" json:"task"`
	Pyroscope   Pyroscope       `yaml:"pyroscope" json:"pyroscope"`
}

func (*Config) Init

func (e *Config) Init(opts ...source.Option)

func (*Config) OnChange

func (e *Config) OnChange()

type Mode

type Mode string
const (
	ModeDev  Mode = "dev"
	ModeTest Mode = "test"
	ModeProd Mode = "prod"
)

type Pyroscope

type Pyroscope struct {
	Enabled                bool                    `yaml:"enabled" json:"enabled"`
	ApplicationName        string                  `yaml:"applicationName" json:"applicationName"` // e.g backend.purchases
	Tags                   map[string]string       `yaml:"tags" json:"tags"`
	ServerAddress          string                  `yaml:"serverAddress" json:"serverAddress"`         // e.g http://pyroscope.services.internal:4040
	AuthToken              string                  `yaml:"authToken" json:"authToken"`                 // specify this token when using pyroscope cloud
	BasicAuthUser          string                  `yaml:"basicAuthUser" json:"basicAuthUser"`         // http basic auth user
	BasicAuthPassword      string                  `yaml:"basicAuthPassword" json:"basicAuthPassword"` // http basic auth password
	TenantID               string                  `yaml:"tenantID" json:"tenantID"`
	UploadRate             time.Duration           `yaml:"uploadRate" json:"uploadRate"`
	Logger                 bool                    `yaml:"logger" json:"logger"`
	ProfileTypes           []pyroscope.ProfileType `yaml:"profileTypes" json:"profileTypes"`
	DisableGCRuns          bool                    `yaml:"disableGCRuns" json:"disableGCRuns"`                   // this will disable automatic runtime.GC runs between getting the heap profiles
	DisableAutomaticResets bool                    `yaml:"disableAutomaticResets" json:"disableAutomaticResets"` // disable automatic profiler reset every 10 seconds. Reset manually by calling Flush method
	HTTPHeaders            map[string]string       `yaml:"httpHeaders" json:"httpHeaders"`
}

func (*Pyroscope) Init

func (e *Pyroscope) Init()

type Task

type Task struct {
	Spec   string `yaml:"spec" json:"spec"`
	Enable bool   `yaml:"enable" json:"enable"`
}

Jump to

Keyboard shortcuts

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