Documentation
¶
Overview ¶
Package herenow publishes an fs.FS as a static site on https://here.now.
Anonymous publishing needs no account: sites expire after 24 hours and the returned ClaimToken/ClaimURL is the only way to update or keep them.
Index ¶
Constants ¶
View Source
const DefaultBaseURL = "https://here.now"
DefaultBaseURL is the here.now API root.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
Status int `json:"-"`
Code string `json:"code"`
Message string `json:"message"`
RetryAfter int `json:"retry_after"`
DocsURL string `json:"docs_url"`
}
Error is a structured here.now API error.
type Options ¶
type Options struct {
// Slug and ClaimToken update an existing anonymous site instead of
// creating a new one. Both come from a previous Result.
Slug string
ClaimToken string
DisplayName string
DisplayDescription string
TTL time.Duration // 0 = server default (24h anonymous)
SPAMode bool
BaseURL string // defaults to DefaultBaseURL
HTTP *http.Client // defaults to http.DefaultClient
APIKey string // optional hnk_… key; empty = anonymous
}
Options tunes a Publish call. The zero value publishes a new anonymous site.
type Result ¶
type Result struct {
Slug string `json:"slug"`
SiteURL string `json:"siteUrl"`
ClaimURL string `json:"claimUrl,omitempty"`
ClaimToken string `json:"claimToken,omitempty"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
Files int `json:"files"`
Uploaded int `json:"uploaded"`
}
Result is a published site.
Click to show internal directories.
Click to hide internal directories.