github.com/astaxie/beego@v1.12.3/logs/alils/log_config.go (about)

     1  package alils
     2  
     3  // InputDetail define log detail
     4  type InputDetail struct {
     5  	LogType       string   `json:"logType"`
     6  	LogPath       string   `json:"logPath"`
     7  	FilePattern   string   `json:"filePattern"`
     8  	LocalStorage  bool     `json:"localStorage"`
     9  	TimeFormat    string   `json:"timeFormat"`
    10  	LogBeginRegex string   `json:"logBeginRegex"`
    11  	Regex         string   `json:"regex"`
    12  	Keys          []string `json:"key"`
    13  	FilterKeys    []string `json:"filterKey"`
    14  	FilterRegex   []string `json:"filterRegex"`
    15  	TopicFormat   string   `json:"topicFormat"`
    16  }
    17  
    18  // OutputDetail define the output detail
    19  type OutputDetail struct {
    20  	Endpoint     string `json:"endpoint"`
    21  	LogStoreName string `json:"logstoreName"`
    22  }
    23  
    24  // LogConfig define Log Config
    25  type LogConfig struct {
    26  	Name         string       `json:"configName"`
    27  	InputType    string       `json:"inputType"`
    28  	InputDetail  InputDetail  `json:"inputDetail"`
    29  	OutputType   string       `json:"outputType"`
    30  	OutputDetail OutputDetail `json:"outputDetail"`
    31  
    32  	CreateTime     uint32
    33  	LastModifyTime uint32
    34  
    35  	project *LogProject
    36  }
    37  
    38  // GetAppliedMachineGroup returns applied machine group of this config.
    39  func (c *LogConfig) GetAppliedMachineGroup(confName string) (groupNames []string, err error) {
    40  	groupNames, err = c.project.GetAppliedMachineGroups(c.Name)
    41  	return
    42  }