util

package
v0.52.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TARGET_GROUP  = "target"
	SERVER_GROUP  = "server"
	PROFILE_GROUP = "profile"
	RUNNER_GROUP  = "runner"
)

Variables

This section is empty.

Functions

func AddDeletedToName added in v0.52.0

func AddDeletedToName(name string) string

func ArrayMap

func ArrayMap[T, U any](data []T, f func(T) U) []U

func CleanUpRepositoryUrl added in v0.24.0

func CleanUpRepositoryUrl(url string) string

func DirectoryValidator added in v0.52.0

func DirectoryValidator(path *string) error

func FormatTimestamp added in v0.26.0

func FormatTimestamp(input string) string

func FormatUptime added in v0.11.0

func FormatUptime(uptime int32) string

func GenerateIdFromName

func GenerateIdFromName(name string) string

func GetEnvVarsFromShell added in v0.28.0

func GetEnvVarsFromShell() map[string]string

func GetFrpcApiDomain added in v0.11.0

func GetFrpcApiDomain(serverId, frpsDomain string) string

func GetFrpcApiUrl added in v0.11.0

func GetFrpcApiUrl(protocol, serverId, frpsDomain string) string

func GetFrpcHeadscaleUrl added in v0.19.0

func GetFrpcHeadscaleUrl(protocol, serverId, frpsDomain string) string

func GetFrpcRegistryDomain added in v0.17.0

func GetFrpcRegistryDomain(serverId, frpsDomain string) string

func GetFrpcRegistryUrl added in v0.17.0

func GetFrpcRegistryUrl(protocol, serverId, frpsDomain string) string

func GetFrpcServerDomain added in v0.11.0

func GetFrpcServerDomain(serverId, frpsDomain string) string

func GetHomeDir added in v0.13.0

func GetHomeDir(activeProfile config.Profile, workspaceId string, gpgKey *string) (string, error)

func GetRemoteOS added in v0.3.0

func GetRemoteOS(remote string) (*os.OperatingSystem, error)

func GetRepositorySlugFromUrl added in v0.15.0

func GetRepositorySlugFromUrl(url string, specifyGitProviders bool) string

func GetSshPrivateKeyPath

func GetSshPrivateKeyPath(privateKeyPath string) (string, *string, error)

GetSshPrivateKeyPath returns the path to the private key and the password if it's encrypted

func GetValidatedName added in v0.24.0

func GetValidatedName(input string) (string, error)

func GetValidatedUrl

func GetValidatedUrl(input string) (string, error)

func GetWebsocketConn added in v0.52.0

func GetWebsocketConn(ctx context.Context, path string, serverUrl string, apiKey string, query *string) (*websocket.Conn, *http.Response, error)

func GetWorkspaceDir added in v0.52.0

func GetWorkspaceDir(activeProfile config.Profile, workspaceId, repoName string, gpgKey *string) (string, error)

func Hash added in v0.35.0

func Hash(value string) string

func MergeEnvVars added in v0.26.1

func MergeEnvVars(envVars ...map[string]string) map[string]string

MergeEnvVars merges multiple environment variables maps into one and resolves environment variables that are referenced in the values. If an environment variable is not found, a warning is logged. The order of the maps is important. Latter maps will override the values of the previous ones.

func Pointer added in v0.24.0

func Pointer[T any](d T) *T

Use generics to create a pointer to a value

func StringsToInterface added in v0.52.0

func StringsToInterface(slice []string) []interface{}

Types

type DebugLogWriter

type DebugLogWriter struct{}

func (*DebugLogWriter) Write

func (w *DebugLogWriter) Write(p []byte) (n int, err error)

type InfoLogWriter

type InfoLogWriter struct{}

func (*InfoLogWriter) Write

func (w *InfoLogWriter) Write(p []byte) (n int, err error)

type LogFormatter added in v0.52.0

type LogFormatter struct {
	TextFormatter    *log.TextFormatter
	ProcessLogWriter io.Writer
}

func (*LogFormatter) Format added in v0.52.0

func (f *LogFormatter) Format(entry *log.Entry) ([]byte, error)

type TraceLogWriter added in v0.28.0

type TraceLogWriter struct{}

func (*TraceLogWriter) Write added in v0.28.0

func (w *TraceLogWriter) Write(p []byte) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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