model

package
v0.0.0-...-4aee4b6 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PlatformCF              = "cloudfoundry"
	PlatformK8s             = "kubernetes"
	RevKey                  = "rev"
	EndOfLifeKey ContextKey = "end-of-life"
	DrainTypeKey            = "drain-type"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BindingCacheConfig

type BindingCacheConfig struct {
	Duration string `cloud:"duration" cloud-default:"10m"`
	PreCache bool   `cloud:"pre_cache"`
}

type BrokerConfig

type BrokerConfig struct {
	PublicHost          string `cloud:"public_host"`
	DrainHost           string `cloud:"drain_host"`
	Username            string `cloud:"username"`
	Password            string `cloud:"password"`
	ForceEmptyDrainType bool   `cloud:"force_empty_drain_type"`
}

type CfResponse

type CfResponse struct {
	Entity struct {
		Name string `json:"name"`
	} `json:"entity"`
}

type Config

type Config struct {
	Web             WebConfig          `cloud:"web"`
	Log             LogConfig          `cloud:"log"`
	SyslogAddresses []SyslogAddress    `cloud:"syslog_addresses"`
	Broker          BrokerConfig       `cloud:"broker"`
	DB              DBConfig           `cloud:"db"`
	Forwarder       ForwarderConfig    `cloud:"forwarder"`
	BindingCache    BindingCacheConfig `cloud:"binding_cache"`
}

func (Config) HasTLS

func (c Config) HasTLS() bool

type ContextBind

type ContextBind struct {
	AppGUID string `json:"app_guid"`
}

type ContextCF

type ContextCF struct {
	OrganizationGUID string `json:"organization_guid,omitempty"`
	SpaceGUID        string `json:"space_guid,omitempty"`
	Endpoint         string `json:"endpoint,omitempty"`
	ServiceGUID      string `json:"service_guid,omitempty"`
}

type ContextK8S

type ContextK8S struct {
	Namespace string `json:"namespace,omitempty"`
	ClusterID string `json:"clusterid,omitempty"`
}

type ContextKey

type ContextKey string

type ContextProvision

type ContextProvision struct {
	ContextCF
	ContextK8S
	Platform string `json:"platform"`
}

func (ContextProvision) IsCloudFoundry

func (c ContextProvision) IsCloudFoundry() bool

func (ContextProvision) IsKubernetes

func (c ContextProvision) IsKubernetes() bool

type DBConfig

type DBConfig struct {
	CnxMaxIdle     int    `cloud:"cnx_max_idle" cloud-default:"20"`
	CnxMaxOpen     int    `cloud:"cnx_max_open" cloud-default:"100"`
	CnxMaxLife     string `cloud:"cnx_max_life" cloud-default:"1h"`
	SQLiteFallback bool   `cloud:"sqlite_fallback"`
	SQLitePath     string `cloud:"sqlite_path" cloud-default:"loghostsvc.db"`
}

type DrainType

type DrainType string

func (*DrainType) UnmarshalJSON

func (dt *DrainType) UnmarshalJSON(b []byte) error

type ForwarderConfig

type ForwarderConfig struct {
	AllowedHosts             []string     `cloud:"allowed_hosts"`
	ParsingKeys              []ParsingKey `cloud:"parsing_keys"`
	IgnoreTagsStructuredData bool         `cloud:"ignore_tags_structured_data"`
}

type InstanceParam

type InstanceParam struct {
	InstanceID   string `gorm:"primary_key"`
	Revision     int    `gorm:"primary_key;auto_increment:false"`
	SpaceID      string
	OrgID        string
	Namespace    string
	SyslogName   string
	CompanyID    string
	UseTls       bool
	DrainType    DrainType
	Patterns     []Pattern     `gorm:"foreignkey:InstanceID"`
	Tags         []Label       `gorm:"foreignkey:InstanceID"`
	SourceLabels []SourceLabel `gorm:"foreignkey:InstanceID"`
}

func (*InstanceParam) BeforeDelete

func (d *InstanceParam) BeforeDelete(tx *gorm.DB) (err error)

func (*InstanceParam) TagsToMap

func (d *InstanceParam) TagsToMap() map[string]string

type KeepAliveConfig

type KeepAliveConfig struct {
	Disabled  bool   `cloud:"disabled"`
	Duration  string `cloud:"duration" cloud-default:"4m"`
	Fuzziness string `cloud:"fuzziness" cloud-default:"1m"`
	// contains filtered or unexported fields
}

func (*KeepAliveConfig) GetDuration

func (f *KeepAliveConfig) GetDuration() *time.Duration

func (*KeepAliveConfig) GetFuzziness

func (f *KeepAliveConfig) GetFuzziness() *time.Duration

type Label

type Label struct {
	ID         uint `gorm:"primary_key;auto_increment"`
	Key        string
	Value      string `gorm:"size:600"`
	InstanceID string
}

func MapToLabels

func MapToLabels(m map[string]string) []Label

type LogConfig

type LogConfig struct {
	Level          string `cloud:"level"`
	JSON           *bool  `cloud:"json"`
	NoColor        bool   `cloud:"no_color"`
	EnableProfiler bool   `cloud:"enable_profiler"`
}

type LogMetadata

type LogMetadata struct {
	BindingID     string        `gorm:"primary_key"`
	InstanceParam InstanceParam `gorm:"foreignkey:InstanceID;association_foreignkey:InstanceID"`
	InstanceID    string
	AppID         string
}

type ParsingKey

type ParsingKey struct {
	Name string `cloud:"name"`
	Hide bool   `cloud:"hide"`
}

type Pattern

type Pattern struct {
	ID         uint   `gorm:"primary_key;auto_increment"`
	Pattern    string `gorm:"size:2550"`
	InstanceID string
}

func ListToPatterns

func ListToPatterns(l []string) []Pattern

type Patterns

type Patterns []Pattern

func (Patterns) ToList

func (p Patterns) ToList() []string

type ProvisionParams

type ProvisionParams struct {
	Patterns  []string          `json:"patterns"`
	Tags      map[string]string `json:"tags"`
	UseTLS    bool              `json:"use_tls"`
	DrainType *DrainType        `json:"drain_type"`
}

type SourceLabel

type SourceLabel struct {
	ID         uint `gorm:"primary_key;auto_increment"`
	Key        string
	Value      string `gorm:"size:600"`
	InstanceID string
}

func MapToSourceLabels

func MapToSourceLabels(m map[string]string) []SourceLabel

type SourceLabels

type SourceLabels []SourceLabel

func (SourceLabels) ToMap

func (labels SourceLabels) ToMap() map[string]string

type SyslogAddress

type SyslogAddress struct {
	ID               string            `cloud:"id"`
	Name             string            `cloud:"name"`
	CompanyID        string            `cloud:"company_id"`
	Description      string            `cloud:"description"`
	DefaultDrainType DrainType         `cloud:"default_drain_type"`
	URLs             []string          `cloud:"urls"`
	Bullets          []string          `cloud:"bullets"`
	Patterns         []string          `cloud:"patterns"`
	Tags             map[string]string `cloud:"tags"`
	SourceLabels     map[string]string `cloud:"source_labels"`
}

func (SyslogAddress) ToServicePlan

func (a SyslogAddress) ToServicePlan() domain.ServicePlan

type SyslogAddresses

type SyslogAddresses []SyslogAddress

func (SyslogAddresses) FoundSyslogWriter

func (a SyslogAddresses) FoundSyslogWriter(planIDOrName string) (SyslogAddress, error)

func (SyslogAddresses) ToServicePlans

func (a SyslogAddresses) ToServicePlans() []domain.ServicePlan

type WebConfig

type WebConfig struct {
	Port         int             `cloud:"port"`
	MaxKeepAlive KeepAliveConfig `cloud:"max_keep_alive"`
	TLS          WebTLSConfig    `cloud:"tls"`
}

func (*WebConfig) GetPort

func (w *WebConfig) GetPort() int

GetPort - Compute port according to gautocloud and configuration

type WebTLSConfig

type WebTLSConfig struct {
	Port     int    `cloud:"port"`
	CertFile string `cloud:"cert_file" cloud-default:""`
	KeyFile  string `cloud:"key_file"  cloud-default:""`
}

Jump to

Keyboard shortcuts

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