Documentation
¶
Index ¶
- type APIError
- type Client
- func (c *Client) ULID(ctx context.Context) (string, error)
- func (c *Client) ULIDBatch(ctx context.Context, count int) ([]string, error)
- func (c *Client) UUIDBatch(ctx context.Context, version string, count int) ([]string, error)
- func (c *Client) UUIDv1(ctx context.Context) (string, error)
- func (c *Client) UUIDv4(ctx context.Context) (string, error)
- func (c *Client) UUIDv7(ctx context.Context) (string, error)
- type ClientOption
- type DecodeError
- type RequestError
- type ULIDListResponse
- type ULIDResponse
- type UUIDListResponse
- type UUIDResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a minimal UUIDify API client.
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
NewClient constructs a new Client, applying any provided options.
type ClientOption ¶
type ClientOption func(*Client)
ClientOption configure a Client.
func WithBaseURL ¶
func WithBaseURL(url string) ClientOption
WithBaseURL overrides the default base URL.
func WithHTTPClient ¶
WithHTTPClient overrides the default HTTP client.
func WithUserAgent ¶
func WithUserAgent(ua string) ClientOption
WithUserAgent overrides the default User-Agent header value.
type DecodeError ¶
type DecodeError struct {
Err error
}
DecodeError wraps errors that occur while decoding API responses.
func (*DecodeError) Error ¶
func (e *DecodeError) Error() string
func (*DecodeError) Unwrap ¶
func (e *DecodeError) Unwrap() error
type RequestError ¶
type RequestError struct {
Err error
}
RequestError wraps lower-level request construction or transport errors.
func (*RequestError) Error ¶
func (e *RequestError) Error() string
func (*RequestError) Unwrap ¶
func (e *RequestError) Unwrap() error
type ULIDListResponse ¶
type ULIDListResponse struct {
ULIDs []string `json:"ulids"`
}
ULIDListResponse represents a response returning multiple ULID values.
type ULIDResponse ¶
type ULIDResponse struct {
ULID string `json:"ulid"`
}
ULIDResponse represents a response returning a single ULID value.
type UUIDListResponse ¶
type UUIDListResponse struct {
UUIDs []string `json:"uuids"`
}
UUIDListResponse represents a response returning multiple UUID values.
type UUIDResponse ¶
type UUIDResponse struct {
UUID string `json:"uuid"`
}
UUIDResponse represents a response returning a single UUID value.