Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the NPM API. It should never be created directly, use NewClient instead.
func NewClient ¶
func NewClient(options ...ClientOption) (*Client, error)
func (*Client) GetPackage ¶
GetPackage returns the package with the given name. It is a convenience function for [GetPackageVersion] with an empty version.
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
ClientOption is an option for configuring a Client.
func WithHTTPClient ¶
func WithHTTPClient(c *http.Client) ClientOption
WithHTTPClient returns a ClientOption that uses the provided http.Client.
func WithLogger ¶
func WithLogger(logger *slog.Logger) ClientOption
WithLogger returns a ClientOption that uses the provided logger.
Click to show internal directories.
Click to hide internal directories.