Documentation ¶
Index ¶
- Constants
- func AddFailIfError(cmd *cobra.Command)
- func AddFailIfNotFoundFlag(cmd *cobra.Command)
- func AddModeFlag(cmd *cobra.Command)
- func AddNotFoundErrIfCond(err error, found bool) error
- func Build(rts sdkservices.Runtimes, srcFS fs.FS, paths []string, syms []sdktypes.Symbol) (*sdkbuildfile.BuildFile, error)
- func BuildProject(pid sdktypes.ProjectID, dirPaths, filePaths []string) (sdktypes.BuildID, error)
- func Client() sdkservices.Services
- func Config() *svc.Config
- func ConfigYAMLFilePath() string
- func Consume(args []string) (data []byte, path string, err error)
- func GetToken() (string, error)
- func InitConfig(confmap map[string]any) (err error)
- func InitRPCClient(authToken string) (err error)
- func JSONRenderer(o any)
- func LimitedContext() (context.Context, context.CancelFunc)
- func NewDevSvc(silent bool) (svc.Service, error)
- func NewNonEmptyString(val string, p *string) *nonEmptyStringValue
- func NewSvc(silent bool) (svc.Service, error)
- func NiceJSONRenderer(o any)
- func OpenURL(cmd *cobra.Command, link string) error
- func ParseModeFlag() (m configset.Mode, err error)
- func Render(o any)
- func RenderKV(k string, v any)
- func RenderKVIfV[T any](k string, v T)
- func RenderList[T fmt.Stringer](ts []T)
- func ServerURL() *url.URL
- func SetRenderer(r Renderer)
- func StandardCommand(cmd *cobra.Command) *cobra.Command
- func StoreToken(token string) error
- func TextRenderer(o any)
- func ToExitCodeError(err error, whats ...string) error
- func ToExitCodeWithSkipNotFoundFlag(cmd *cobra.Command, err error, whats ...string) error
- func WithLimitedContext(ctx context.Context) (context.Context, context.CancelFunc)
- type ExitCodeError
- type KV
- type KVIfV
- type Renderer
- type ToStringer
Constants ¶
const ( EnvVarPrefix = "AK_" ConfigYAMLFileName = "config.yaml" )
const ( NotFoundExitCode = 10 NotAMemberExitCode = NotFoundExitCode FailedPrecondition = 64 GenericFailure = 1 )
Variables ¶
This section is empty.
Functions ¶
func AddFailIfError ¶ added in v0.3.0
func AddFailIfNotFoundFlag ¶
func AddModeFlag ¶ added in v0.5.0
AddModeFlag adds the AutoKitteh service mode flag to the given CLI command. See also ParseModeFlag.
func AddNotFoundErrIfCond ¶ added in v0.8.4
keep given error, if passed or return notFound if !found condition
func Build ¶ added in v0.3.2
func Build(rts sdkservices.Runtimes, srcFS fs.FS, paths []string, syms []sdktypes.Symbol) (*sdkbuildfile.BuildFile, error)
func BuildProject ¶ added in v0.4.0
func Client ¶
func Client() sdkservices.Services
func ConfigYAMLFilePath ¶
func ConfigYAMLFilePath() string
func InitConfig ¶
func InitRPCClient ¶
func JSONRenderer ¶
func JSONRenderer(o any)
func LimitedContext ¶
func LimitedContext() (context.Context, context.CancelFunc)
func NewNonEmptyString ¶ added in v0.9.0
func NewSvc ¶ added in v0.5.0
Returns a new AutoKitteh service initialized with the mode defined by AddModeFlag and parsed by ParseModeFlag.
func NiceJSONRenderer ¶
func NiceJSONRenderer(o any)
func ParseModeFlag ¶ added in v0.9.2
ParseModeFlag returns the parsed value of the AutoKitteh service mode CLI flag, initialized with AddModeFlag.
func RenderKVIfV ¶
func RenderList ¶
func SetRenderer ¶
func SetRenderer(r Renderer)
func StoreToken ¶ added in v0.5.1
func TextRenderer ¶
func TextRenderer(o any)
func ToExitCodeError ¶ added in v0.3.0
ToExitCodeError wraps the given error with an OS exit code. If the error is nil, it also returns nil.
func ToExitCodeWithSkipNotFoundFlag ¶ added in v0.8.4
ToExitCodeWithSkipNotFoundFlag returns the given command's error (may be nil) with an OS exit code, but considers the "--fail" flag: if set to false, we skip "not found" errors.
func WithLimitedContext ¶ added in v0.4.0
TODO(ENG-320): Configuration to disable timeout for debugging.
Types ¶
type ExitCodeError ¶
func NewExitCodeError ¶
func NewExitCodeError(code int, err error) ExitCodeError
func (ExitCodeError) Error ¶
func (e ExitCodeError) Error() string
type KV ¶
func (KV) MarshalJSON ¶
type KVIfV ¶
This will not print anything if V is nil for text rendering. Should make output parsing easier for get operations. TODO: should we even care for non-json output parsing?
func (KVIfV[T]) MarshalJSON ¶
type ToStringer ¶ added in v0.8.5
type ToStringer interface{ ToString() string }