Documentation ¶
Index ¶
- Constants
- func CombineManifests(yamls []string) string
- func FloatFloor(v float64, per int) float64
- func FloatRound(v float64, per int) float64
- func FormatSize(size int) (res string)
- func FormatTime(t time.Time) string
- func NewKSuid() string
- func NewRequestID() string
- func NewShortUUID() string
- func NewTraceID() string
- func NewXID() string
- func Now() time.Time
- func ParseGitRepo(source string) (owner, repo string, err error)
- func ParseTime(str string) (time.Time, error)
- func RegisterValidation(name string, fn validator.Func) error
- func ShortenFileBase(baseDir, fullPath string) string
- func SplitManifests(content string) []string
- func Validate(i interface{}) error
- func ValidateSnakeCase(fl validator.FieldLevel) bool
- type GitURL
- type Timestamps
Constants ¶
View Source
const ( GitMethodSSH = "ssh" GitMethodHTTPS = "https" GitMethodHTTP = "http" )
View Source
const (
TimeLayout = time.RFC3339
)
Variables ¶
This section is empty.
Functions ¶
func CombineManifests ¶
func FormatTime ¶
func NewRequestID ¶
func NewRequestID() string
func NewShortUUID ¶
func NewShortUUID() string
func ParseGitRepo ¶
ParseGitRepo source: 087-group/appserver_mars_service owner: 087-group repo: appserver_mars_service
func RegisterValidation ¶
func ShortenFileBase ¶
ShortenFileBase removes baseDir from fullPath (but keep the last element of baseDir). e.g. ShortenFileBase("a/b", "a/b/c.go") => "b/c.go"
func SplitManifests ¶
func ValidateSnakeCase ¶
func ValidateSnakeCase(fl validator.FieldLevel) bool
Types ¶
type GitURL ¶
type GitURL struct { Method string // ssh or https, default is ssh Host string Namespace string Repo string }
func ParseGitUrl ¶
ParseGitUrl 解析git地址 "ssh_url": "git@git.atcloudbox.com:087-group/appserver_mars_service.git", "http_url": "https://git.atcloudbox.com/087-group/appserver_mars_service.git"
type Timestamps ¶
type Timestamps int64 // 秒
func NowTimestamps ¶
func NowTimestamps() Timestamps
func ToTimestamps ¶
func ToTimestamps(t time.Time) Timestamps
func (Timestamps) MarshalBinary ¶
func (t Timestamps) MarshalBinary() (data []byte, err error)
func (Timestamps) String ¶
func (t Timestamps) String() string
func (Timestamps) Time ¶
func (t Timestamps) Time() time.Time
func (Timestamps) UnmarshalBinary ¶
func (t Timestamps) UnmarshalBinary(data []byte) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.