Documentation
¶
Overview ¶
Package cmdutil holds the flag helpers that commands share: cursor pagination, partial-update readers, repeatable flags, required flags that can be asked for, idempotency keys, and the content and sender flags of templates and campaigns.
Readers return errors from the errors package, so a bad flag fails as a validation error before the command authenticates.
Index ¶
- Constants
- Variables
- func AddAPIKeyCreateFlags(cmd *cobra.Command, owner KeyOwner)
- func AddAPIKeyUpdateFlags(cmd *cobra.Command, owner KeyOwner)
- func AddCreateContentFlags(cmd *cobra.Command)
- func AddFlagAlias(cmd *cobra.Command, old, name string)
- func AddIdempotencyKeyFlag(cmd *cobra.Command)
- func AddInteractiveAlias(cmd *cobra.Command)
- func AddLegacyCursorAlias(cmd *cobra.Command)
- func AddNegatedFlagAlias(cmd *cobra.Command, old, name string)
- func AddOneOfFlag(cmd *cobra.Command, name, value, usage string, values []string)
- func AddPaginationFlags(cmd *cobra.Command)
- func AddPersistentOneOfFlag(cmd *cobra.Command, name, value, usage string, values []string)
- func AddRepeatableFlag(cmd *cobra.Command, name, usage string)
- func AddRepeatableOneOfFlag(cmd *cobra.Command, name, usage string, values []string)
- func AddSenderFlags(cmd *cobra.Command)
- func AddSenderNameFlag(cmd *cobra.Command)
- func AddUpdateContentFlags(cmd *cobra.Command)
- func AddUpdateSenderFlags(cmd *cobra.Command, clearFromUsage string)
- func AddValueAlias(cmd *cobra.Command, old, name, value string)
- func AskIfEmpty(cmd *cobra.Command, value, label, missing string) (string, error)
- func ChangedBool(cmd *cobra.Command, name string) *bool
- func ChangedString(cmd *cobra.Command, name string) *string
- func CheckCredentialFlags(cmd *cobra.Command) error
- func CheckIdempotencyKey(key string, requests int) error
- func CheckMaxCleanedLength(name string, value *string, max int, clean func(string) string) error
- func CheckMaxLength(name string, value *string, max int) error
- func CheckReservedHeaders(headers map[string]string, reserved []ReservedHeader) error
- func CheckScopeDomains(scope string, domains []string) error
- func CheckSubjectAndPreheader(cmd *cobra.Command) error
- func CompleteNoFiles(cmd *cobra.Command)
- func CompleteProfileArgument(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func CompleteProfileNames(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)
- func CompleteValues(cmd *cobra.Command, name string, values []string)
- func DecodeJSON(r io.Reader, target any, subject, kind string) error
- func DecodeJSONStrict(r io.Reader, target any, subject, kind string) error
- func ExactArgs(n int) cobra.PositionalArgs
- func FindHeader(headers map[string]string, name string) (string, bool)
- func IdempotencyKeyFor(key string, index, requests int) string
- func IdempotencyOptions(cmd *cobra.Command) ([]api.RequestOption, error)
- func JoinFilter(values []string) *string
- func MarkFileFlag(cmd *cobra.Command, name string)
- func MarkNoEffect(cmd *cobra.Command, name, hint string)
- func MatchOneOf(cmd *cobra.Command, name, value string) (string, error)
- func MaximumNArgs(n int) cobra.PositionalArgs
- func MinimumNArgs(n int) cobra.PositionalArgs
- func NoArgs(cmd *cobra.Command, args []string) error
- func NonEmptyString(cmd *cobra.Command, name string) *string
- func QuotePath(path string) string
- func ReadAPIKeyCreate(cmd *cobra.Command, owner KeyOwner) (requests.CreateAPIKeyRequest, error)
- func ReadAPIKeyUpdate(cmd *cobra.Command, owner KeyOwner) (requests.UpdateAPIKeyRequest, error)
- func ReadAttachPaths(cmd *cobra.Command) ([]string, error)
- func ReadClearable(cmd *cobra.Command, name, clearFlag string) (*string, bool, error)
- func ReadContent(cmd *cobra.Command) (*requests.TemplateContentInput, error)
- func ReadDataItems[T any](path, itemsName, itemName string) ([]T, error)
- func ReadFilterOneOf(cmd *cobra.Command, name string) (*string, error)
- func ReadFilterTags(cmd *cobra.Command) ([]string, error)
- func ReadFlagFile(flag, path string) (string, error)
- func ReadHeaders(cmd *cobra.Command, name string) (map[string]string, error)
- func ReadIdempotencyKey(cmd *cobra.Command) (string, error)
- func ReadInputFile(flag, path string) ([]byte, error)
- func ReadListUpdate(cmd *cobra.Command, name, clearFlag string) (*[]string, error)
- func ReadNonEmpty(cmd *cobra.Command, name, clearFlag string) (*string, error)
- func ReadOneOf(cmd *cobra.Command, name string) (*string, error)
- func ReadOrAsk(cmd *cobra.Command, name, label string) (string, error)
- func ReadPagination(cmd *cobra.Command) (limit *int32, after, before *string, err error)
- func ReadPaginationParams(cmd *cobra.Command) (common.PaginationParams, error)
- func ReadPastTimeRange(cmd *cobra.Command) (from, to *time.Time, err error)
- func ReadRepeatable(cmd *cobra.Command, name, clearFlag string) ([]string, error)
- func ReadRequiredText(cmd *cobra.Command, name string) (string, error)
- func ReadSandboxResult(cmd *cobra.Command) (string, error)
- func ReadSecretOrAsk(cmd *cobra.Command, name, label string) (string, error)
- func ReadSender(cmd *cobra.Command) (*common.SenderAddress, error)
- func ReadSenderName(cmd *cobra.Command) (*string, error)
- func ReadTemplateEditor(cmd *cobra.Command, content *requests.TemplateContentInput) (*string, error)
- func RejectTogether(cmd *cobra.Command, first, second string) error
- func ScopesHelp(owner KeyOwner) string
- func ShellQuote(value string) string
- func TypedName(cmd *cobra.Command, name string) string
- func UsageArguments(cmd *cobra.Command) []string
- func ValidateWebhookURL(name, rawURL string) error
- func WarnIfInsecureURL(cmd *cobra.Command, name, rawURL, sent string)
- type Attachment
- type KeyOwner
- type ReservedHeader
Constants ¶
const ( FromUsage = "Sender email address" ToUsage = "Recipient email address (can be used multiple times)" SubjectUsage = "Email subject" TextUsage = "Plain text content" HTMLUsage = "HTML content" TextFileUsage = "File with the plain text content" HTMLFileUsage = "File with the HTML content" HeaderUsage = `` /* 128-byte string literal not displayed */ AttachUsage = "File to attach" SandboxUsage = "Send in sandbox mode, which delivers nothing" SandboxResultUsage = "Sandbox result simulation: %s (needs --sandbox)" TagUsage = "Message tag (can be used multiple times)" TrackOpensUsage = "Track opens (--track-opens=false turns it off); the account's setting applies when omitted" TrackClicksUsage = "Track clicks (--track-clicks=false turns it off); the account's setting applies when omitted" )
The help of the flags messages send and smtp send share, so each flag reads the same in both. A command adds what applies to it alone, such as when a flag is required.
const ( WebhookSends = "each event" RouteSends = "each email" )
What the URL of a webhook and of a route are sent, in the warning of WarnIfInsecureURL.
const AttachSizeLimit = "10,485,760 bytes (10 MiB)"
AttachSizeLimit is MaxAttachmentSize in the words of help and errors: in bytes, as the limit of all attachments together is given, and in MiB.
const MaxAttachmentSize = 10 * 1024 * 1024
MaxAttachmentSize is the largest file --attach accepts, in bytes, which AttachSizeLimit gives as help and errors do.
const MaxDataFileItems = 1000
MaxDataFileItems is the most items a batch file may hold.
const MaxNameLength = 255
MaxNameLength is the most characters the API accepts in a name or a label.
Variables ¶
var ( // Scopes are the scopes of a webhook or an SMTP credential. Scopes = []string{"global", "scoped"} // SandboxResults are the results a sandbox send simulates. SandboxResults = []string{"deliver", "bounce", "defer", "fail", "suppress"} // SubscriptionStatusFilters are the membership statuses a list of // memberships can be filtered by. SubscriptionStatusFilters = []string{"unconfirmed", "confirmed", "unsubscribed", "complained"} )
The values of the enum flags that several command groups share, as the API defines them.
Functions ¶
func AddAPIKeyCreateFlags ¶
AddAPIKeyCreateFlags adds the --label, --scope and --ip-allow-list flags of a command that creates a key of owner. ReadAPIKeyCreate reads them.
func AddAPIKeyUpdateFlags ¶
AddAPIKeyUpdateFlags adds the --label, --scope, --ip-allow-list and --clear-ip-allow-list flags of a command that updates a key of owner. ReadAPIKeyUpdate reads them.
func AddCreateContentFlags ¶
AddCreateContentFlags adds the content flags of a create command: --mjml-file, --html-file, --text-file and --editor.
func AddFlagAlias ¶
AddFlagAlias adds old as a hidden, deprecated name of the flag name. Each value given to old is set on name, so the command reads only name. The alias of a bool flag is a switch, as addSwitchAlias describes.
func AddIdempotencyKeyFlag ¶
AddIdempotencyKeyFlag adds the --idempotency-key flag.
func AddInteractiveAlias ¶
AddInteractiveAlias adds --interactive as a hidden, deprecated switch that sets --non-interactive to false, for a command that had --interactive before --non-interactive replaced it.
func AddLegacyCursorAlias ¶
AddLegacyCursorAlias keeps --cursor, the flag older versions paged with, as a hidden, deprecated alias of --after.
func AddNegatedFlagAlias ¶
AddNegatedFlagAlias adds old as a hidden, deprecated switch that sets the bool flag name to false: --old is --name=false.
func AddOneOfFlag ¶
AddOneOfFlag adds the string flag name, with the default value, whose value is one of values. Its help is usage with the values listed in place of its %s, such as "Sending type: transactional or marketing", and the shell completes the values. MatchOneOf, ReadOneOf and ReadFilterOneOf check a value of it against them.
func AddPaginationFlags ¶
AddPaginationFlags adds --limit, --after and --before to a list command whose endpoint pages both ways.
func AddPersistentOneOfFlag ¶
AddPersistentOneOfFlag is AddOneOfFlag for a persistent flag, which the subcommands of cmd take too.
func AddRepeatableFlag ¶
AddRepeatableFlag adds a flag that can be used multiple times. Like every repeatable flag of the CLI, it splits each value on commas, as a CSV line, so --tag a,b is --tag a --tag b. A value that holds a comma must be in double quotes, with any double quote in it doubled: --tag '"news, weekly"'. A value that is not such a CSV line is a validation error.
func AddRepeatableOneOfFlag ¶
AddRepeatableOneOfFlag is AddOneOfFlag for a flag that can be given several times, as AddRepeatableFlag adds it; MatchOneOf checks each value.
func AddSenderFlags ¶
AddSenderFlags adds --from and --from-name.
func AddSenderNameFlag ¶
AddSenderNameFlag adds --from-name, for a command that declares --from itself. ReadSenderName reads it.
func AddUpdateContentFlags ¶
AddUpdateContentFlags adds the content flags of an update command: --mjml-file, --html-file, --text-file and --regenerate-text.
func AddUpdateSenderFlags ¶
AddUpdateSenderFlags adds --from, --from-name and --clear-from, with clearFromUsage as the help of --clear-from.
func AddValueAlias ¶
AddValueAlias adds old as a hidden, deprecated switch that sets the flag name to value: --old is --name value.
func AskIfEmpty ¶
AskIfEmpty returns value, or, when it is empty and prompt.CanPrompt allows it, the answer to a prompt with label. A value that is still empty is the validation error missing.
func ChangedBool ¶
ChangedBool returns the value of a bool flag, or nil when the flag was not set on the command line.
func ChangedString ¶
ChangedString returns the value of a string flag, or nil when the flag was not set on the command line. An explicitly empty value is returned as a pointer to "".
func CheckCredentialFlags ¶
CheckCredentialFlags checks the --api-key and --account-id flags given on the command line: the two go together, the key cannot be empty, and the account ID must be a UUID. It runs before authentication.
func CheckIdempotencyKey ¶
CheckIdempotencyKey checks --idempotency-key for a command that sends requests requests with the keys of IdempotencyKeyFor: a key with a character that is not printable ASCII, which an HTTP header cannot carry as it is, and a key whose longest form is longer than the API accepts are validation errors.
func CheckMaxCleanedLength ¶
CheckMaxCleanedLength is CheckMaxLength for a value the API cleans before it counts its characters: it counts value once clean has cleaned it as the API does, such as strings.TrimSpace for a name the API trims, or cleanTemplateText. The value is still sent as given, for the API to clean.
func CheckMaxLength ¶
CheckMaxLength checks that value, the value of the flag name, has at most max characters, when there is a value.
func CheckReservedHeaders ¶
func CheckReservedHeaders(headers map[string]string, reserved []ReservedHeader) error
CheckReservedHeaders returns a validation error that names the first of reserved that headers holds, in any case, with its hint.
func CheckScopeDomains ¶
CheckScopeDomains checks the --scope and --domains of a new webhook or SMTP credential: a scoped one needs domains, and a global one takes none, since the API would ignore them and leave it unrestricted.
func CheckSubjectAndPreheader ¶
CheckSubjectAndPreheader checks that --subject and --preheader, when set, fit maxSubjectLength and maxPreheaderLength, counted as the API counts them, once cleanTemplateText cleaned them.
func CompleteNoFiles ¶
CompleteNoFiles makes the shell complete no file name where cmd and its subcommands take none: for every argument without completions of its own, since no command takes a file as an argument, and for every flag that has no completions of its own and is not marked with MarkFileFlag, nor a deprecated name of such a flag. A flag without either would complete file names, Cobra's default.
func CompleteProfileArgument ¶
func CompleteProfileArgument(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
CompleteProfileArgument completes the profile argument of a command that takes one profile name.
func CompleteProfileNames ¶
CompleteProfileNames completes the names of the profiles in the configuration file. It reads the file only: it makes no request, and completes nothing, silently, when there is no file.
func CompleteValues ¶
CompleteValues makes the shell complete the flag name of cmd with values, the values the flag's validation accepts.
func DecodeJSON ¶
DecodeJSON decodes the one JSON value r holds, a value of kind such as "JSON object", into target; every JSON input a user gives is read with it. Numbers are kept as json.Number, so they are sent as written. Input that is empty, is not one value of kind (null included) or does not fit target is a validation error that names the input as subject, such as "--attributes".
func DecodeJSONStrict ¶
DecodeJSONStrict is DecodeJSON for input whose every key target names, such as a recipients file: a key target lacks, such as a misspelt one, is a validation error that names it.
func FindHeader ¶
FindHeader returns the name in headers that is name in any case, and whether there is one.
func IdempotencyKeyFor ¶
IdempotencyKeyFor returns the idempotency key of the request at index, from 0, of a command that sends requests requests: key itself for a single request, otherwise key followed by "-" and index.
func IdempotencyOptions ¶
func IdempotencyOptions(cmd *cobra.Command) ([]api.RequestOption, error)
IdempotencyOptions returns the request option that sends --idempotency-key, or no option when the flag is not given, so the SDK generates the key. A key ReadIdempotencyKey or CheckIdempotencyKey refuses is a validation error; commands call it before authenticating.
func JoinFilter ¶
JoinFilter returns values joined with commas, the form the API takes a filter of several values in, or nil when there are none.
func MarkFileFlag ¶
MarkFileFlag marks the flag name of cmd as taking a file path, which the shell completes; CompleteNoFiles leaves it so.
func MarkNoEffect ¶
MarkNoEffect hides the flag name and marks it deprecated, as a flag that is accepted for compatibility and has no effect. hint, when not empty, tells what to use instead.
func MatchOneOf ¶
MatchOneOf returns the value of the flag name, added by AddOneOfFlag, that value matches ignoring case, so the request carries the API's spelling. A value that matches none is a validation error.
func MaximumNArgs ¶
func MaximumNArgs(n int) cobra.PositionalArgs
MaximumNArgs accepts up to n arguments.
func MinimumNArgs ¶
func MinimumNArgs(n int) cobra.PositionalArgs
MinimumNArgs accepts n or more arguments.
func NonEmptyString ¶
NonEmptyString returns the value of a string flag, or nil when the value is empty or blank, of white space only, so such a filter is left out of the request.
func QuotePath ¶
QuotePath returns path as an argument a user can paste into a command line of the system's shell: on Windows, whose cmd.exe passes single quotes on as part of the argument, path in double quotes when it holds a character other than a letter, a digit or one of windowsPathSafe, such as a space, ', &, ^ or $, and path itself otherwise; elsewhere, path as ShellQuote quotes it.
func ReadAPIKeyCreate ¶
ReadAPIKeyCreate reads the flags AddAPIKeyCreateFlags adds into a create request for a key of owner. A missing label or scope and an invalid scope are validation errors.
func ReadAPIKeyUpdate ¶
ReadAPIKeyUpdate reads the flags AddAPIKeyUpdateFlags adds into an update request for a key of owner that holds only the fields given. Giving none of them, an empty value and an invalid scope are validation errors.
func ReadAttachPaths ¶
ReadAttachPaths returns the paths of the repeatable --attach flag, as ReadRepeatable does. A path that does not exist and came from a value the flag split at a comma, as --attach 'inv,2026.txt' splits into inv and 2026.txt, is a validation error that says to quote a file name with a comma.
func ReadClearable ¶
ReadClearable returns the value of the string flag name, or nil when it was not set, and whether the bool flag clearFlag, such as --clear-from, was given. A command without clearFlag, such as a create command, has nothing to clear. An empty value is a validation error, which points to clearFlag when the command has it.
func ReadContent ¶
func ReadContent(cmd *cobra.Command) (*requests.TemplateContentInput, error)
ReadContent builds the content from the content flags, or returns nil when none is set.
func ReadDataItems ¶
ReadDataItems reads a batch file with readDataFile and decodes each item with decodeDataItem. itemsName names the items and itemName one item in error messages, such as "contacts" and "contact".
func ReadFilterOneOf ¶
ReadFilterOneOf returns the value of the filter flag name, added by AddOneOfFlag, in the spelling of its values, or nil when it is empty, so an empty filter is left out of the request. A value that is not one of its values is a validation error.
func ReadFilterTags ¶
ReadFilterTags returns the values of the repeatable flag --tag of a command that filters by tag. The API takes the tags joined with commas and splits them at each comma, so a tag that holds one, given in double quotes, is a validation error: the API would look for its parts instead.
func ReadFlagFile ¶
ReadFlagFile returns the text of the file at path, which the flag named flag gives, as ReadInputFile reads it.
func ReadHeaders ¶
ReadHeaders returns the custom headers of the repeatable flag name, each given as "Name: value", by header name, or nil when the flag was not set. A value without a colon or a name is a validation error, and so is a name the API refuses: one that holds a space or a character that is not visible ASCII. The name is checked as given, so the part of a header value after an unquoted ", ", which the flag splits off as another header, fails for its leading space; a part after an unquoted "," fails for its missing colon. Both errors say to quote a value with a comma. Header names ignore case, so a name given twice, in any case, is a validation error.
func ReadIdempotencyKey ¶
ReadIdempotencyKey returns --idempotency-key, or "" when it was not given. An empty or blank key, and a key that starts or ends with white space, are validation errors: Go's HTTP client drops the white space around a header value, so the API would get another key than the one given, or none.
func ReadInputFile ¶
ReadInputFile returns the content of the file at path, which the flag named flag gives, without a leading UTF-8 byte order mark; every text or data file a user gives is read with it. A missing or unreadable file, and a file that is not UTF-8 text, are validation errors: the API takes UTF-8, and sending other bytes would replace each character that is not UTF-8.
func ReadListUpdate ¶
ReadListUpdate returns the list an update sends for the repeatable flag name and the bool flag clearFlag: the values, an empty list when clearFlag is set, or nil to keep the list unchanged.
func ReadNonEmpty ¶
ReadNonEmpty returns the value of a string flag, or nil when the flag was not set. A blank value is a validation error; clearFlag names the flag that clears the field, which the error points to, or is "" when there is none.
func ReadOneOf ¶
ReadOneOf returns the value of the flag name, added by AddOneOfFlag, in the spelling of its values, or nil when the flag was not set. An empty value, or one that is not one of its values, is a validation error.
func ReadOrAsk ¶
ReadOrAsk returns the value of the required text flag name. A blank value is the validation error "--name cannot be empty". When the flag is missing and prompt.CanPrompt allows it, it asks for the value with label; a missing value, or a blank answer, is the validation error "--name is required".
func ReadPagination ¶
ReadPagination returns the pagination flags for the command to copy into its SDK params. A zero limit and an empty cursor are returned as nil.
func ReadPaginationParams ¶
func ReadPaginationParams(cmd *cobra.Command) (common.PaginationParams, error)
ReadPaginationParams returns the pagination flags as the SDK's pagination params.
func ReadPastTimeRange ¶
ReadPastTimeRange returns the times of the --from-time and --to-time flags, each nil when it is empty. A --from-time that is not before --to-time is a validation error.
func ReadRepeatable ¶
ReadRepeatable returns the values of a repeatable flag, each without leading and trailing spaces, so --tag "news, weekly" gives news and weekly, or nil when the flag was not set, so the request field it fills stays nil. An empty value, such as the one after a trailing comma, is a validation error; clearFlag names the flag that clears the field, which the error points to, or is "" when there is none.
func ReadRequiredText ¶
ReadRequiredText returns the value of the required text flag name, which it never asks for, unlike ReadOrAsk. A missing flag is the validation error "--name is required", and a blank value is "--name cannot be empty".
func ReadSandboxResult ¶
ReadSandboxResult returns --sandbox-result in the API's spelling. A value that is not a sandbox result is a validation error, and so is --sandbox-result without --sandbox, which would send real mail.
func ReadSecretOrAsk ¶
ReadSecretOrAsk is ReadOrAsk for a secret, such as a password, which is taken as given, so only an empty value fails: it asks with prompt.PromptSecret, so a terminal hides the answer as it is typed.
func ReadSender ¶
func ReadSender(cmd *cobra.Command) (*common.SenderAddress, error)
ReadSender builds the sender from the sender flags, or returns nil when none is set. --clear-from returns an empty address, which the SDK sends as null.
func ReadSenderName ¶
ReadSenderName returns the value of --from-name, or nil when it was not set. --from-name without --from is a validation error.
func ReadTemplateEditor ¶
func ReadTemplateEditor(cmd *cobra.Command, content *requests.TemplateContentInput) (*string, error)
ReadTemplateEditor returns --editor of a template create, or nil when it is not set. The API needs an editor when the content holds neither MJML nor HTML.
func RejectTogether ¶
RejectTogether returns a validation error when flags first and second are both set on the command line. The error names each flag as the user gave it, under a deprecated alias when that is the name used, in the order the user gave them.
func ScopesHelp ¶
ScopesHelp is the section of the help of a command that takes --scope that lists every scope a key of owner can have, from validation.ScopeGroups.
func ShellQuote ¶
ShellQuote returns value as a word a user can paste into a command line of a POSIX shell, such as bash or zsh: value itself when it holds only characters no such shell treats specially, otherwise value in single quotes, where each single quote of value ends the quoting, is escaped with a backslash and starts it again. A value that starts with =, which zsh expands to the path of a command, is quoted too.
func TypedName ¶
TypedName returns the name the user gave the flag name under: a deprecated alias of it, or name itself.
func UsageArguments ¶
UsageArguments returns the names of the arguments the usage line of cmd names, such as sub-account-id and key-id for "get <sub-account-id> <key-id>", and domain for "create [domain]". Flag values, such as <label> in "--label <label>", are not arguments.
func ValidateWebhookURL ¶
ValidateWebhookURL checks that rawURL, the value of the flag name, is an absolute HTTP or HTTPS URL. Commands that accept it call WarnIfInsecureURL once every other input is valid.
func WarnIfInsecureURL ¶
WarnIfInsecureURL writes validation.PlainHTTPWarning to stderr when rawURL, the value of the flag name, sends what it is sent over plain HTTP to a host that is not a loopback host; sent names that, such as "each event" for a webhook or "each email" for a route. Warnings never reach stdout, so JSON output stays the API response alone.
Types ¶
type Attachment ¶
Attachment is a file read for --attach.
func ReadAttachments ¶
func ReadAttachments(paths []string) ([]Attachment, error)
ReadAttachments reads every --attach file, so a send fails before it connects when one cannot be attached. A missing or unreadable file, a directory or other file that is not a regular one, such as a device or a named pipe, and a file over MaxAttachmentSize are validation errors.
type KeyOwner ¶
type KeyOwner int
KeyOwner is whose API key a command creates or updates, which decides the scopes the key can have.
type ReservedHeader ¶
ReservedHeader is a header name that --header refuses, in any case, with the hint that says how to set it instead.