Documentation
¶
Index ¶
- Constants
- Variables
- func CheckFileOverSSH(filePath string, user string, host string, privateKeyFilePath string, ...) bool
- func CheckLocalFile(filePath string) bool
- func FormatForecastTimeShort(forecastTime time.Duration) string
- func GenerateForecastTime(forecastTime time.Duration, timeInterval string) time.Duration
- func GenerateStartTime(startTime time.Time, hour int) time.Time
- func GetDay(startTime time.Time) string
- func GetForecastHour(forecastTime time.Duration) int
- func GetForecastMinute(forecastTime time.Duration) int
- func GetHour(startTime time.Time) string
- func GetMonth(startTime time.Time) string
- func GetYear(startTime time.Time) string
- func LoadConfigContent(configDir string, dataType string) (string, error)
- func ParseForecastTime(value string) (time.Duration, error)
- func ParseStartTime(value string) (time.Time, error)
- func PrepareLocalDir(filePath string)
- func PrintVersionInformation()
- type DataConfig
- type PathItem
- func FindHpcFile(config DataConfig, locationLevels []string, startTime time.Time, ...) PathItem
- func FindLocalFile(config DataConfig, locationLevels []string, startTime time.Time, ...) PathItemdeprecated
- func FindLocalFileV2(config DataConfig, locationLevels []string, startTime time.Time, ...) PathItem
- type TimeTemplateVariable
Constants ¶
const ConfigFileBasename = ".yaml"
Variables ¶
var ( Version = "Unknown version" BuildTime = "Unknown build time" GitCommit = "Unknown GitCommit" )
Functions ¶
func CheckFileOverSSH ¶
func CheckLocalFile ¶
func FormatForecastTimeShort ¶ added in v0.9.0
func GenerateForecastTime ¶ added in v0.9.0
GenerateForecastTime generate a new time duration calculated from a forecast time and a time interval. should be used with getForecastHour, getForecastMinute functions.
func GenerateStartTime ¶ added in v0.9.0
GenerateStartTime generates a new time add or minus some hours. used in template files. should be used with getYear, getMonth, getDay, getHour functions. usage:
{generateStartTime .StartTime -3 | getYear}
func GetForecastHour ¶ added in v0.9.0
GetForecastHour get hour from forecast time. used in template files. Usage:
{.ForecastTime | getForecastHour | printf "%03d"}
func GetForecastMinute ¶ added in v0.9.0
GetForecastMinute get minute from forecast time. used in template files. Usage:
{.ForecastTime | getForecastMinute | printf "%02d"}
func LoadConfigContent ¶ added in v0.9.0
LoadConfigContent read config content from a local file or from embedded config strings.
func PrepareLocalDir ¶
func PrepareLocalDir(filePath string)
func PrintVersionInformation ¶
func PrintVersionInformation()
Types ¶
type DataConfig ¶
type DataConfig struct {
Default string `yaml:"default"`
FileName string `yaml:"file_name"`
FileNames []string `yaml:"file_names"`
Paths []PathItem `yaml:"paths"`
}
func LoadConfig ¶
func LoadConfig(configDir string, dataType string) (DataConfig, error)
func LoadDataConfigFromContent ¶ added in v0.9.0
func LoadDataConfigFromContent(content string) (DataConfig, error)
LoadDataConfigFromContent parse DataConfig from string content.
func ParseConfigContent ¶ added in v0.9.0
func ParseConfigContent(content string, startTime time.Time, forecastTime time.Duration) (DataConfig, error)
ParseConfigContent parse config content template with start time and forecast time.
type PathItem ¶
type PathItem struct {
PathType string `yaml:"type"`
LevelType string `yaml:"level"`
Path string `yaml:"path"`
}
func FindHpcFile ¶
func FindLocalFile
deprecated
func FindLocalFileV2 ¶ added in v0.9.0
type TimeTemplateVariable ¶
type TimeTemplateVariable struct {
StartTime time.Time
ForecastTime time.Duration
Year string
Month string
Day string
Hour string
ForecastHour string
ForecastMinute string
}
func GenerateTimeTemplateVariable ¶
func GenerateTimeTemplateVariable(startTime time.Time, forecastTime time.Duration) TimeTemplateVariable