Documentation
¶
Index ¶
- func FetchGetDecoded[T any](opts cmdutil.Options, spinnerMessage, path string, params url.Values) (T, error)
- func FetchPostJSON(opts cmdutil.Options, spinnerMessage, path string, payload any) (json.RawMessage, error)
- func NewAPIClient(opts cmdutil.Options, token string) *adminapi.Client
- func ResolveMutationToken(opts cmdutil.Options) (adminconfig.TokenInfo, error)
- func Run(opts cmdutil.Options, spinnerMessage string, run ClientRunner, ...) error
- func RunDecoded[T any](opts cmdutil.Options, spinnerMessage string, run ClientRunner, ...) error
- func RunGet(opts cmdutil.Options, spinnerMessage, path string, params url.Values, ...) error
- func RunGetDecoded[T any](opts cmdutil.Options, spinnerMessage, path string, params url.Values, ...) error
- func RunPostJSONDecoded[T any](opts cmdutil.Options, spinnerMessage, path string, payload any, ...) error
- func WriteActorBanner(opts cmdutil.Options, info adminconfig.TokenInfo) error
- type ClientRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchGetDecoded ¶
func FetchGetDecoded[T any](opts cmdutil.Options, spinnerMessage, path string, params url.Values) (T, error)
FetchGetDecoded fetches a GET endpoint and decodes the response without rendering it. Use it when chaining requests where only the data is needed.
func FetchPostJSON ¶
func FetchPostJSON(opts cmdutil.Options, spinnerMessage, path string, payload any) (json.RawMessage, error)
FetchPostJSON posts a JSON payload and returns the raw response without rendering it. Use this when the caller needs to keep transport-level failures distinguishable from post-success render/decode errors (e.g. so only the POST failure gets a "request failed" wrapper).
func ResolveMutationToken ¶ added in v0.12.0
func ResolveMutationToken(opts cmdutil.Options) (adminconfig.TokenInfo, error)
ResolveMutationToken resolves the token policy used by mutating admin commands.
func Run ¶
func Run(opts cmdutil.Options, spinnerMessage string, run ClientRunner, render func(json.RawMessage) error) error
func RunDecoded ¶
func RunGetDecoded ¶
func RunPostJSONDecoded ¶
func WriteActorBanner ¶ added in v0.12.0
func WriteActorBanner(opts cmdutil.Options, info adminconfig.TokenInfo) error
WriteActorBanner prints the stored admin actor banner for mutating commands.
Types ¶
type ClientRunner ¶
type ClientRunner func(*adminapi.Client) (json.RawMessage, error)
Click to show internal directories.
Click to hide internal directories.