util

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WORKSPACE_GROUP = "workspace"
	SERVER_GROUP    = "server"
	PROFILE_GROUP   = "profile"
)

Variables

This section is empty.

Functions

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 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, projectName string) (string, error)

func GetProjectDir added in v0.13.0

func GetProjectDir(activeProfile config.Profile, workspaceId string, projectName 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 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 ReadJSONLog added in v0.20.0

func ReadJSONLog(ctx context.Context, logReader io.Reader, follow bool, c chan interface{}, errChan chan error)

func ReadLog

func ReadLog(ctx context.Context, logReader io.Reader, follow bool, c chan []byte, errChan chan error)

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 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