utils

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	McpLogFileName = "mcp_logging.log"
)

Variables

This section is empty.

Functions

func AddFormatFlag

func AddFormatFlag(flags *pflag.FlagSet, formatPtr *Format)

func CloseMcpLogFile added in v1.3.0

func CloseMcpLogFile()

func Contains

func Contains(array []string, str string) bool

func ConvertUnixTimeToTime

func ConvertUnixTimeToTime(timeUnix float64) time.Time

func DisplayTime

func DisplayTime(time time.Time) string

func GetAllPages

func GetAllPages[T any](
	ctx context.Context,
	client *aponoapi.AponoClient,
	nextPageFunc func(context.Context, *aponoapi.AponoClient, int32) ([]T, *clientapi.PaginationClientInfoModel, error),
) ([]T, error)

func InitMcpLogFile added in v1.3.0

func InitMcpLogFile() error

func IsDateAfterDaysOffset

func IsDateAfterDaysOffset(date time.Time, daysOffset int64) bool

func IsFlagSet

func IsFlagSet(cmd *cobra.Command, flagName string) bool

func IsValidUUID

func IsValidUUID(u string) bool

func McpLogf added in v1.3.0

func McpLogf(format string, args ...interface{})

func PrintObjectsAsJSON

func PrintObjectsAsJSON(writer io.Writer, objects any) error

func PrintObjectsAsYaml

func PrintObjectsAsYaml(writer io.Writer, objects any) error

func ReturnAPIResponseError

func ReturnAPIResponseError(resp *http.Response) error

Types

type Format

type Format enumflag.Flag
const (
	TableFormat Format = iota
	JSONFormat
	YamlFormat
)

Jump to

Keyboard shortcuts

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