Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultInvoiceBaseURL is the production origin for the MoneyForward // Invoice API v3. It is exported so packages outside config (e.g. // internal/api) can fall back to the same default when callers // construct a Config manually without going through Load. DefaultInvoiceBaseURL = "https://invoice.moneyforward.com" )
Variables ¶
This section is empty.
Functions ¶
func NormalizeInvoiceBaseURL ¶ added in v0.2.0
NormalizeInvoiceBaseURL validates and normalizes a raw Invoice API base URL value. It is exported so api.NewInvoiceClient can apply the same strict rules to manually constructed Config values without relying on Load.
Rules:
- Empty / whitespace-only input falls back to DefaultInvoiceBaseURL.
- Scheme must be http or https.
- Host must be present.
- RawQuery, Fragment, and Userinfo must be empty.
- Trailing slashes are trimmed; a trailing "/api/v3" segment is also trimmed (origin-only contract). Any other non-empty path is rejected.
Types ¶
type Config ¶
type Config struct {
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
BaseURL string `json:"base_url"`
InvoiceBaseURL string `json:"invoice_base_url"`
ConfigDir string `json:"-"`
AuthPort int `json:"auth_port"`
}
func (*Config) RequireClientID ¶
RequireClientID returns an error if ClientID is not set.
Click to show internal directories.
Click to hide internal directories.