client

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ExitOK          = 0
	ExitGeneric     = 1
	ExitUsage       = 2
	ExitAuth        = 3
	ExitNotFound    = 4
	ExitValidation  = 5
	ExitRateLimited = 6
	ExitServer      = 7
)

Documented CLI exit-code scheme (see docs/api-reference.md and the architecture). The cmd layer maps outcomes to these and os.Exit()s with them.

Variables

This section is empty.

Functions

func ExitCode

func ExitCode(err error) int

ExitCode maps a Client error to the documented exit-code scheme. A nil error is success (0); an *APIError maps by HTTP status (401→auth, 404→not-found, 429→rate-limited, other 4xx→validation, 5xx→server, 0→generic); any other error is generic (1). Wrapped *APIErrors are unwrapped via errors.As.

Types

type APIError

type APIError struct {
	StatusCode int
	Code       string
	Message    string
}

APIError is returned by Client methods when the request fails or the server returns an error envelope. StatusCode carries the HTTP status (0 for a transport-level failure); Code/Message come from the server's error object.

func (*APIError) Error

func (e *APIError) Error() string

Error implements the error interface.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a typed HTTP client over the /api/v1 surface. It depends only on the JSON contract (stdlib) — it imports no server internals — which is what lets a future MCP server reuse it. Construct it with New.

func New

func New(baseURL, apiKey string) (*Client, error)

New builds a Client targeting baseURL authenticated with apiKey. The base URL is normalized (trailing slash trimmed) and must be an http(s) scheme + host with no userinfo and no path (the client appends /api/v1/...); rejecting a path avoids a silent double-prefix when callers proxy under a path. The returned Client follows redirects but strips the API key on cross-host hops. A default 30s per-request timeout is applied so a hung server cannot block the CLI indefinitely.

func (*Client) CatalogGetProduct added in v1.1.0

func (c *Client) CatalogGetProduct(
	ctx context.Context,
	contentID int,
) (json.RawMessage, json.RawMessage, error)

CatalogGetProduct sends GET /api/v1/catalog/products/{contentID} and returns the decoded admin commerce data and meta payloads, or an *APIError on failure. Unknown content IDs read 404 NOT_FOUND; non-admin keys read 403.

func (*Client) CatalogUpsertProduct added in v1.1.0

func (c *Client) CatalogUpsertProduct(
	ctx context.Context,
	contentID int,
	body map[string]any,
) (json.RawMessage, json.RawMessage, error)

CatalogUpsertProduct sends PUT /api/v1/catalog/products/{contentID} with the given commerce body (the admin wire shape: price, salePrice, sku, trackInventory, stock, weightGrams, lowStockThreshold, options, variants) and returns the decoded data and meta payloads, or an *APIError on failure. The call replaces the variant matrix; callers that only change scalars should read first and resend the stored axes.

func (*Client) CreateComment added in v0.3.0

func (c *Client) CreateComment(
	ctx context.Context,
	contentID int,
	req CreateCommentRequest,
) (json.RawMessage, json.RawMessage, error)

CreateComment POSTs a comment to /api/v1/content/{id}/comments and returns the decoded data and meta payloads, or an *APIError on failure.

func (*Client) CreateContent

func (c *Client) CreateContent(
	ctx context.Context,
	req CreateContentRequest,
) (json.RawMessage, json.RawMessage, error)

CreateContent POSTs a content-create request to /api/v1/content and returns the decoded data and meta payloads, or an *APIError on failure.

func (*Client) DeleteComment added in v0.3.0

func (c *Client) DeleteComment(
	ctx context.Context,
	contentID int,
	commentID int,
) (json.RawMessage, json.RawMessage, error)

DeleteComment sends DELETE /api/v1/content/{id}/comments/{commentId}. A 204 No Content success returns (nil, nil, nil); a 404 or other 4xx/5xx returns an *APIError. An admin key may delete any comment; a non-admin key only its own (the server returns 404 for a comment the caller does not own, no disclosure).

func (*Client) DeleteContent

func (c *Client) DeleteContent(
	ctx context.Context,
	id int,
) (json.RawMessage, json.RawMessage, error)

DeleteContent sends DELETE /api/v1/content/{id}. A 204 No Content success returns (nil, nil, nil); a 404 or other 4xx/5xx returns an *APIError.

func (*Client) DeleteMedia added in v1.1.0

func (c *Client) DeleteMedia(
	ctx context.Context,
	id int,
) (json.RawMessage, json.RawMessage, error)

DeleteMedia sends DELETE /api/v1/media/{id} and returns nil data and meta on success (204 No Content carries no envelope), or an *APIError on failure. Non-owners read 403; ghost ids read 404.

func (*Client) ExportContent added in v0.8.0

func (c *Client) ExportContent(ctx context.Context, output io.Writer, opts DownloadOptions) error

ExportContent streams the export tar.gz from GET /api/v1/export into output. output receives the raw tar.gz bytes on success; any error is an *APIError. Bounds come from DownloadOptions; the caller controls the overall deadline via ctx as well.

func (*Client) GenerateSite added in v0.8.0

func (c *Client) GenerateSite(ctx context.Context, output io.Writer, opts DownloadOptions) error

GenerateSite streams the SSG tar.gz from GET /api/v1/ssg into output. output receives the raw tar.gz bytes on success; any error is an *APIError. Bounds come from DownloadOptions; the caller controls the overall deadline via ctx as well.

func (*Client) GetContent

func (c *Client) GetContent(
	ctx context.Context,
	id int,
) (json.RawMessage, json.RawMessage, error)

GetContent sends GET /api/v1/content/{id} and returns the decoded data and meta payloads, or an *APIError on failure.

func (*Client) GetHugoImportStatus added in v0.8.0

func (c *Client) GetHugoImportStatus(
	ctx context.Context,
	jobID string,
) (json.RawMessage, json.RawMessage, error)

GetHugoImportStatus sends GET /api/v1/hugo/import/status/{jobId} and returns the decoded data (containing the job status) or an *APIError on failure. When jobId is empty it fetches the most recent job.

func (*Client) GetImportStatus added in v0.8.0

func (c *Client) GetImportStatus(
	ctx context.Context,
	jobID string,
) (json.RawMessage, json.RawMessage, error)

GetImportStatus sends GET /api/v1/wordpress/import/status/{jobId} and returns the decoded data (containing the job status) or an *APIError on failure. When jobId is empty it fetches the most recent job.

func (*Client) GetMedia

func (c *Client) GetMedia(
	ctx context.Context,
	id int,
) (json.RawMessage, json.RawMessage, error)

GetMedia sends GET /api/v1/media/{id} and returns the decoded data and meta payloads, or an *APIError on failure.

func (*Client) ImportHugo added in v0.8.0

func (c *Client) ImportHugo(
	ctx context.Context,
	req ImportHugoRequest,
) (json.RawMessage, json.RawMessage, error)

ImportHugo sends POST /api/v1/hugo/import as multipart/form-data with a `file` part (the tar.gz archive) and an optional `skipMedia` field, then returns the decoded data (containing jobId and state) or an *APIError on failure. Uses its own HTTP client without a hard timeout so large uploads succeed; the caller controls the overall deadline via ctx.

func (*Client) ImportWordPress added in v0.8.0

func (c *Client) ImportWordPress(
	ctx context.Context,
	req ImportWordPressRequest,
) (json.RawMessage, json.RawMessage, error)

ImportWordPress sends POST /api/v1/wordpress/import as multipart/form-data with a `file` part and an optional `skipMedia` field, then returns the decoded data (containing jobId and state) or an *APIError on failure. Uses its own HTTP client without a hard timeout so large uploads succeed; the caller controls the overall deadline via ctx.

func (*Client) InvoiceSettingsGet added in v1.1.0

func (c *Client) InvoiceSettingsGet(
	ctx context.Context,
) (json.RawMessage, json.RawMessage, error)

InvoiceSettingsGet sends GET /api/v1/orders/invoice-settings and returns the decoded live block (seller identity plus PPN rate) and meta payloads, or an *APIError on failure.

func (*Client) InvoiceSettingsSet added in v1.1.0

func (c *Client) InvoiceSettingsSet(
	ctx context.Context,
	body map[string]any,
) (json.RawMessage, json.RawMessage, error)

InvoiceSettingsSet sends PUT /api/v1/orders/invoice-settings with the given block and returns the decoded saved block and meta payloads, or an *APIError on failure. Missing, non-finite, or out-of-range taxRate reads 400; the save applies to the next rendered invoice without a restart.

func (*Client) ListComments added in v0.3.0

func (c *Client) ListComments(
	ctx context.Context,
	contentID int,
) (json.RawMessage, json.RawMessage, error)

ListComments sends GET /api/v1/content/{id}/comments and returns the decoded data (a bare array of comment projections) and meta, or an *APIError on failure.

func (*Client) ListContent

func (c *Client) ListContent(
	ctx context.Context,
	limit int,
	cursor string,
	filters ListContentFilters,
) (json.RawMessage, json.RawMessage, error)

ListContent sends GET /api/v1/content?limit=&cursor=&tag=&language=&status=&post_type=&author=&search= and returns the decoded data (a bare array of content projections) and meta (with pagination), or an *APIError on failure. A limit of 0 (or negative) is passed as "no limit" (the server uses its default); an empty cursor is passed as "no cursor" (the first page). Each non-empty filter field emits its query key; an empty field is omitted entirely so the wire stays minimal. Tags is expanded into repeated ?tag= keys (one per tag) so the server can AND-of-tags.

func (*Client) ListMedia

func (c *Client) ListMedia(
	ctx context.Context,
	limit int,
	cursor string,
) (json.RawMessage, json.RawMessage, error)

ListMedia sends GET /api/v1/media?limit=&cursor= and returns the decoded data (a bare array of media projections) and meta (with pagination), or an *APIError on failure. A limit of 0 (or negative) is passed as "no limit" (the server uses its default); an empty cursor is passed as "no cursor" (the first page).

func (*Client) OrdersGet added in v1.1.0

func (c *Client) OrdersGet(
	ctx context.Context,
	id int64,
) (json.RawMessage, json.RawMessage, error)

OrdersGet sends GET /api/v1/orders/{orderID} and returns the decoded order detail (full item snapshot) and meta payloads, or an *APIError on failure. Unknown IDs read 404 NOT_FOUND; non-admin keys read 403.

func (*Client) OrdersList added in v1.1.0

func (c *Client) OrdersList(
	ctx context.Context,
	status string,
	cursor string,
) (json.RawMessage, json.RawMessage, error)

OrdersList sends GET /api/v1/orders with optional status and cursor filters and returns the decoded data (newest-first order summaries) and meta (with pagination), or an *APIError on failure. Empty filters are omitted so the default call lists everything.

func (*Client) OrdersSetShipping added in v1.1.0

func (c *Client) OrdersSetShipping(
	ctx context.Context,
	id int64,
	amount int64,
) (json.RawMessage, json.RawMessage, error)

OrdersSetShipping sends POST /api/v1/orders/{orderID}/shipping with the shipping line in integer minor units and returns the decoded order and meta payloads, or an *APIError on failure. Only pending orders carry shipping; settled orders refuse with 409.

func (*Client) OrdersTransition added in v1.1.0

func (c *Client) OrdersTransition(
	ctx context.Context,
	id int64,
	status string,
) (json.RawMessage, json.RawMessage, error)

OrdersTransition sends POST /api/v1/orders/{orderID}/status with the target lifecycle status and returns the decoded order and meta payloads, or an *APIError on failure. Illegal moves read 409; "paid" is refused outright — payment confirmation is the only path into paid.

func (*Client) PaymentsGet added in v1.1.0

func (c *Client) PaymentsGet(
	ctx context.Context,
	id int64,
) (json.RawMessage, json.RawMessage, error)

PaymentsGet sends GET /api/v1/payments/{paymentID} and returns the decoded payment record with its order context and meta payloads, or an *APIError on failure.

func (*Client) PaymentsList added in v1.1.0

func (c *Client) PaymentsList(
	ctx context.Context,
	status string,
	cursor string,
) (json.RawMessage, json.RawMessage, error)

PaymentsList sends GET /api/v1/payments with optional status and cursor filters and returns the decoded data (newest-first payment records) and meta (with pagination), or an *APIError on failure. Empty filters are omitted so the default call lists everything.

func (*Client) PaymentsReject added in v1.1.0

func (c *Client) PaymentsReject(
	ctx context.Context,
	id int64,
) (json.RawMessage, json.RawMessage, error)

PaymentsReject sends POST /api/v1/payments/{paymentID}/reject with an empty body and returns the decoded rejected record and meta payloads, or an *APIError on failure. The order stays pending; proofs whose order already left pending read 409 with no rejection email.

func (*Client) PaymentsVerify added in v1.1.0

func (c *Client) PaymentsVerify(
	ctx context.Context,
	id int64,
) (json.RawMessage, json.RawMessage, error)

PaymentsVerify sends POST /api/v1/payments/{paymentID}/verify with an empty body and returns the decoded verified record and meta payloads, or an *APIError on failure. Decided records read 409, as do proofs whose order already left pending.

func (*Client) PublishContent

func (c *Client) PublishContent(
	ctx context.Context,
	id int,
) (json.RawMessage, json.RawMessage, error)

PublishContent sends POST /api/v1/content/{id}/publish with an empty body and returns the decoded data and meta payloads, or an *APIError on failure. The server endpoint is idempotent: publishing an already-published post returns 200 with the current projection. Ownership is enforced server-side; a non-admin non-owner call returns 404 (not 403, no disclosure).

func (*Client) SetSystemFields added in v0.2.0

func (c *Client) SetSystemFields(
	ctx context.Context,
	id int,
	systemFields map[string]any,
) (json.RawMessage, json.RawMessage, error)

SetSystemFields sends PUT /api/v1/content/{id}/system-fields with the given system field key/value pairs and returns the decoded data and meta payloads, or an *APIError on failure. System fields are admin-managed metadata (e.g. editorial_status, internal_notes), so the server returns 403 FORBIDDEN unless the API key belongs to an Admin; an unknown key returns ErrUnknownSystemFieldKey and a value that fails the field schema returns ErrSystemFieldValidation, both surfaced as a 400 VALIDATION_ERROR.

func (*Client) UnpublishContent

func (c *Client) UnpublishContent(
	ctx context.Context,
	id int,
) (json.RawMessage, json.RawMessage, error)

UnpublishContent sends POST /api/v1/content/{id}/unpublish with an empty body and returns the decoded data and meta payloads, or an *APIError on failure. The server endpoint is idempotent: unpublishing an already-draft post returns 200 with the current projection. Same ownership contract as PublishContent.

func (*Client) UpdateCommentStatus added in v0.3.0

func (c *Client) UpdateCommentStatus(
	ctx context.Context,
	contentID int,
	commentID int,
	status string,
) (json.RawMessage, json.RawMessage, error)

UpdateCommentStatus sends PUT /api/v1/content/{id}/comments/{commentId}/status with the given status (approved/rejected/spam) and returns the decoded data and meta payloads, or an *APIError on failure. Admin only: the server returns 403 FORBIDDEN to a non-admin key.

func (*Client) UpdateContent

func (c *Client) UpdateContent(
	ctx context.Context,
	id int,
	req UpdateContentRequest,
) (json.RawMessage, json.RawMessage, error)

UpdateContent sends PUT /api/v1/content/{id} with the given request body and returns the decoded data and meta payloads, or an *APIError on failure. The request body is the same shape as CreateContent. The server's update handler preserves the server-managed fields (SEO metadata — metaDescription / ogTitle / ogDescription, allowComments, translationGroupId) from the existing item, so a partial update that omits them is safe; postType / tags / language are now settable and forwarded as-given (the server validates them).

func (*Client) UploadMedia

func (c *Client) UploadMedia(
	ctx context.Context,
	req UploadMediaRequest,
) (json.RawMessage, json.RawMessage, error)

UploadMedia sends POST /api/v1/media as multipart/form-data with a `file` part and an optional `metadata` JSON part, then returns the decoded data and meta payloads (the server returns 200 with the media projection in the data envelope) or an *APIError on failure.

The multipart body is buffered in memory; the server enforces its own size limit at r.ParseMultipartForm. The 204/304+envelope defenses from doRequest apply unchanged.

func (*Client) UsersApprove added in v1.1.0

func (c *Client) UsersApprove(
	ctx context.Context,
	id int64,
) (json.RawMessage, json.RawMessage, error)

UsersApprove sends POST /api/v1/users/{id}/approve with an empty body and returns the decoded decision and meta payloads, or an *APIError on failure. Unverified emails and non-pending users read 409/400.

func (*Client) UsersList added in v1.1.0

func (c *Client) UsersList(
	ctx context.Context,
	status string,
	limit int,
	offset int,
) (json.RawMessage, json.RawMessage, error)

UsersList sends GET /api/v1/users with optional status, limit, and offset filters and returns the decoded data (user summaries) and meta payloads, or an *APIError on failure. Empty filters are omitted.

func (*Client) UsersMarkSpam added in v1.1.0

func (c *Client) UsersMarkSpam(
	ctx context.Context,
	id int64,
) (json.RawMessage, json.RawMessage, error)

UsersMarkSpam sends POST /api/v1/users/{id}/mark-spam with the confirmation body and returns the decoded decision and meta payloads, or an *APIError on failure.

func (*Client) UsersPending added in v1.1.0

func (c *Client) UsersPending(
	ctx context.Context,
) (json.RawMessage, json.RawMessage, error)

UsersPending sends GET /api/v1/users/pending and returns the decoded registration queue and meta payloads, or an *APIError on failure.

func (*Client) UsersReject added in v1.1.0

func (c *Client) UsersReject(
	ctx context.Context,
	id int64,
) (json.RawMessage, json.RawMessage, error)

UsersReject sends POST /api/v1/users/{id}/reject with the confirmation body and returns the decoded decision and meta payloads, or an *APIError on failure. Unconfirmed calls read 400.

func (*Client) UsersSoftDelete added in v1.1.0

func (c *Client) UsersSoftDelete(
	ctx context.Context,
	id int64,
	reason string,
) (json.RawMessage, json.RawMessage, error)

UsersSoftDelete sends POST /api/v1/users/{id}/soft-delete with the confirmation body and returns the decoded decision and meta payloads, or an *APIError on failure. Unconfirmed calls read 400.

func (*Client) UsersSuspend added in v1.1.0

func (c *Client) UsersSuspend(
	ctx context.Context,
	id int64,
	reason string,
) (json.RawMessage, json.RawMessage, error)

UsersSuspend sends POST /api/v1/users/{id}/suspend with an optional reason and returns the decoded decision and meta payloads, or an *APIError on failure. Settled states read 409.

func (*Client) UsersUnsuspend added in v1.1.0

func (c *Client) UsersUnsuspend(
	ctx context.Context,
	id int64,
) (json.RawMessage, json.RawMessage, error)

UsersUnsuspend sends POST /api/v1/users/{id}/unsuspend with an empty body and returns the decoded decision and meta payloads, or an *APIError on failure.

type CreateCommentRequest added in v0.3.0

type CreateCommentRequest struct {
	Comment string `json:"comment"`
}

CreateCommentRequest is the agent comment-create payload. It mirrors the {data, error, meta} contract documented in docs/api-reference.md — the client hard-codes it (it cannot import the server's DTO types).

type CreateContentRequest

type CreateContentRequest struct {
	Title              string         `json:"title"`
	Slug               string         `json:"slug,omitempty"`
	Body               string         `json:"body"`
	Format             string         `json:"format,omitempty"`
	PostType           string         `json:"postType,omitempty"`
	Tags               []string       `json:"tags,omitempty"`
	Language           string         `json:"language,omitempty"`
	IsPublished        bool           `json:"isPublished,omitempty"`
	CustomFields       map[string]any `json:"customFields,omitempty"`
	TranslationGroupID *int           `json:"translationGroupId,omitempty"`
}

CreateContentRequest is the agent content-create payload. It mirrors the {data, error, meta} contract documented in docs/api-reference.md — the client hard-codes it (it cannot import the server's DTO types).

All metadata fields (PostType, Tags, Language) use `omitempty` so an unset value is identical on the wire to a default-zero request. Tags must already be normalized by the caller (the CLI's normalizeTags helper trims, drops empties, and dedupes); the server re-validates via contentdomain.ValidateTags. Language is forwarded as-given — the server is the single source of truth for the configured-languages list (it returns ErrInvalidLanguage for an unknown code, mapped to 400 VALIDATION_ERROR by the CLI's exit code map).

type DownloadOptions added in v1.1.0

type DownloadOptions struct {
	Timeout  time.Duration
	MaxBytes int64
}

DownloadOptions bounds a tarball download. Timeout caps the whole request (dial through body); MaxBytes caps the body size — a limit the operator can raise with --max-download-size for genuinely huge sites. Zero values mean unbounded (the historical behavior); prefer explicit bounds against untrusted servers.

type ImportHugoRequest added in v0.8.0

type ImportHugoRequest struct {
	// File is the tar.gz archive reader.
	File io.Reader
	// Filename is the archive file name used in the multipart form.
	Filename string
	// SkipMedia, when true, tells the server to skip migrating static
	// images into Lesstruct media; images stay linked to their original
	// paths or URLs.
	SkipMedia bool
}

ImportHugoRequest is the multipart payload sent to POST /api/v1/hugo/import. It carries a tar.gz archive of the Hugo project (containing at least a content/ directory) and an optional skipMedia flag.

type ImportJobStatus added in v0.8.0

type ImportJobStatus struct {
	State         string   `json:"state"`
	Imported      int      `json:"imported"`
	Skipped       int      `json:"skipped"`
	UsersImported int      `json:"usersImported"`
	Total         int      `json:"total"`
	Errors        []string `json:"errors,omitempty"`
	StartedAt     string   `json:"startedAt"`
	FinishedAt    string   `json:"finishedAt,omitempty"`
}

ImportJobStatus reflects the current state of an in-flight or completed WordPress import job, mirroring the server's importJob JSON shape.

type ImportWordPressRequest added in v0.8.0

type ImportWordPressRequest struct {
	// File is the WXR XML file reader.
	File io.Reader
	// Filename is the file name used in the multipart form.
	Filename string
	// SkipMedia, when true, tells the server to skip downloading
	// inline images and featured images during import.
	SkipMedia bool
}

ImportWordPressRequest is the multipart payload sent to POST /api/v1/wordpress/import. It carries the WXR XML file and optional skipMedia flag.

type ListContentFilters

type ListContentFilters struct {
	Tags     []string
	Language string
	Status   string
	PostType string
	Author   string
	Search   string
}

ListContentFilters is the cmd-layer projection of contentdomain.ContentFilters for the agent List endpoint. The CLI re-declares the shape (it cannot import server-internal types) so the wire contract is the source of truth, and only the fields used by the agent v1 surface are exposed here. Tags is intentionally a slice — the wire format uses repeated ?tag= keys (one per tag, AND-of-tags on the server). An empty / zero struct produces a no-filter call (server returns the unfiltered list).

type UpdateContentRequest

type UpdateContentRequest struct {
	Title        string         `json:"title"`
	Body         string         `json:"body"`
	Format       string         `json:"format,omitempty"`
	PostType     string         `json:"postType,omitempty"`
	Tags         []string       `json:"tags,omitempty"`
	Language     string         `json:"language,omitempty"`
	IsPublished  bool           `json:"isPublished,omitempty"`
	CustomFields map[string]any `json:"customFields,omitempty"`
}

UpdateContentRequest is the agent content-update payload. It carries the same fields as CreateContentRequest because the server's PUT /api/v1/content/{id} accepts the same ContentRequest shape. The server preserves the server-managed fields (SEO metadata — metaDescription / ogTitle / ogDescription, allowComments, translationGroupId) from the existing item; the client does not surface a flag for translationGroupId on update (the server ignores it). CustomFields may be set: when non-nil it replaces the item's custom fields (preserving plugin-managed system fields); when nil the existing custom fields are preserved. The client cannot import the server's DTO types so the subset is re-declared here.

type UploadMediaRequest

type UploadMediaRequest struct {
	File     io.Reader
	Filename string
	Metadata map[string]any
}

UploadMediaRequest is the multipart payload sent to POST /api/v1/media. It is built in memory by UploadMedia — callers supply the file reader + filename and an optional metadata map (the server reads `altText` today; the map values are passed through as typed JSON so non-string values such as numbers or booleans are accepted, even though the server currently persists only `altText`). The client validates that File is non-nil and Filename is non-empty so a bad call site fails fast with a clear error instead of a runtime panic.

Jump to

Keyboard shortcuts

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