common

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

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

Go to latest
Published: Jul 29, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPipelineExecutionCreatedUnix is the default unix timestamp for pipeline execution creation time. 2024-03-01 00:00:00
	DefaultPipelineExecutionCreatedUnix int64 = 1709222400000

	// DefaultGitImage is the default git image
	DefaultGitImage = "hub.zentao.net/ci/gitfox-plugin-git:2.0"
	// DefaultPlaceholderImage is the default placeholder image
	DefaultPlaceholderImage = "hub.zentao.net/ci/gitfox-plugin-placeholder:1"
)

Variables

View Source
var (
	Version       string
	BuildDate     string
	GitCommitHash string
	GitBranch     string
)

Functions

func DayEndTime

func DayEndTime(t carbon.Carbon) time.Time

DayEndTime 获取一天的结束时间

func DayEndUnix

func DayEndUnix(t carbon.Carbon) int64

DayEndUnix 获取一天的结束时间 秒

func DayEndUnixMilli

func DayEndUnixMilli(t carbon.Carbon) int64

DayEndUnixMilli 获取一天的结束时间 毫秒

func DayEndUnixRFC3339

func DayEndUnixRFC3339(t carbon.Carbon) string

DayEndUnixRFC3339 获取一天的结束时间 格式化

func DayStartTime

func DayStartTime(t carbon.Carbon) time.Time

DayStartTime 获取一天的开始时间

func DayStartUnix

func DayStartUnix(t carbon.Carbon) int64

DayStartUnix 获取一天的开始时间 秒

func DayStartUnixMilli

func DayStartUnixMilli(t carbon.Carbon) int64

DayStartUnixMilli 获取一天的开始时间 毫秒

func DayStartUnixRFC3339

func DayStartUnixRFC3339(t carbon.Carbon) string

DayStartUnixRFC3339 获取一天的开始时间 格式化 2025-01-01T00:00:00Z

func GetClient

func GetClient(cfg *types.AIConfig) (ai.Generative, error)

GetClient returns the generative client based on the platform

func GetEnv

func GetEnv(envstr string, fallback ...string) string

GetEnv 获取环境变量

func GetVersionWithHash

func GetVersionWithHash() string

GetVersionWithHash returns the version string with the git commit hash and build date.

func GitImage

func GitImage() string

func NewDeepSeek

func NewDeepSeek(cfg *types.AIConfig) (*openai.Client, error)

func NewOpenAI

func NewOpenAI(cfg *types.AIConfig) (*openai.Client, error)

func PlaceholderImage

func PlaceholderImage() string

Types

type ErrWrongURLFormat

type ErrWrongURLFormat struct {
	URL string
}

ErrWrongURLFormat represents an error with wrong url format

func (ErrWrongURLFormat) Error

func (err ErrWrongURLFormat) Error() string

type GitURL

type GitURL struct {
	*stdurl.URL
	// contains filtered or unexported fields
}

GitURL represents a git URL

func Parse

func Parse(remote string) (*GitURL, error)

Parse parse all kinds of git URL

func (*GitURL) String

func (u *GitURL) String() string

String returns the URL's string

Jump to

Keyboard shortcuts

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