npm

package
v0.0.0-...-890248b Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package npm provides a client for Nginx Proxy Manager API integration.

Package npm provides NPM integration services including auto-proxy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Error   interface{} `json:"error"`
	Message string      `json:"message"`
}

APIError represents an NPM API error.

type AccessList

type AccessList struct {
	ID         int                    `json:"id,omitempty"`
	CreatedOn  string                 `json:"created_on,omitempty"`
	ModifiedOn string                 `json:"modified_on,omitempty"`
	Name       string                 `json:"name"`
	SatisfyAny bool                   `json:"satisfy_any"`
	PassAuth   bool                   `json:"pass_auth"`
	Items      []AccessListItem       `json:"items,omitempty"`
	Clients    []AccessListClient     `json:"clients,omitempty"`
	Meta       map[string]interface{} `json:"meta,omitempty"`
}

AccessList represents an NPM access list.

type AccessListClient

type AccessListClient struct {
	Address   string `json:"address"`
	Directive string `json:"directive"` // allow or deny
}

AccessListClient represents a client IP rule.

type AccessListCreate

type AccessListCreate struct {
	Name       string             `json:"name"`
	SatisfyAny bool               `json:"satisfy_any,omitempty"`
	PassAuth   bool               `json:"pass_auth,omitempty"`
	Items      []AccessListItem   `json:"items,omitempty"`
	Clients    []AccessListClient `json:"clients,omitempty"`
}

AccessListCreate is the input for creating an access list.

type AccessListItem

type AccessListItem struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

AccessListItem represents an authorization item (username/password).

type Certificate

type Certificate struct {
	ID          int                    `json:"id,omitempty"`
	CreatedOn   string                 `json:"created_on,omitempty"`
	ModifiedOn  string                 `json:"modified_on,omitempty"`
	Provider    string                 `json:"provider"` // letsencrypt, other
	NiceName    string                 `json:"nice_name"`
	DomainNames []string               `json:"domain_names"`
	ExpiresOn   string                 `json:"expires_on,omitempty"`
	Meta        map[string]interface{} `json:"meta,omitempty"`
}

Certificate represents an NPM certificate.

type CertificateRequest

type CertificateRequest struct {
	DomainNames            []string               `json:"domain_names"`
	Meta                   map[string]interface{} `json:"meta,omitempty"`
	LetsencryptEmail       string                 `json:"letsencrypt_email,omitempty"`
	LetsencryptAgree       bool                   `json:"letsencrypt_agree,omitempty"`
	DNSChallenge           bool                   `json:"dns_challenge,omitempty"`
	DNSProvider            string                 `json:"dns_provider,omitempty"`
	DNSProviderCredentials string                 `json:"dns_provider_credentials,omitempty"`
	PropagationSeconds     int                    `json:"propagation_seconds,omitempty"`
}

CertificateRequest represents a request to create a Let's Encrypt certificate.

type Client

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

Client is a client for the Nginx Proxy Manager API.

func NewClient

func NewClient(config *Config, logger *zap.Logger) *Client

NewClient creates a new NPM API client.

func (*Client) CreateAccessList

func (c *Client) CreateAccessList(ctx context.Context, list *AccessList) (*AccessList, error)

CreateAccessList creates a new access list.

func (*Client) CreateDeadHost

func (c *Client) CreateDeadHost(ctx context.Context, host *DeadHost) (*DeadHost, error)

CreateDeadHost creates a new dead host.

func (*Client) CreateProxyHost

func (c *Client) CreateProxyHost(ctx context.Context, host *ProxyHost) (*ProxyHost, error)

CreateProxyHost creates a new proxy host.

func (*Client) CreateRedirectionHost

func (c *Client) CreateRedirectionHost(ctx context.Context, host *RedirectionHost) (*RedirectionHost, error)

CreateRedirectionHost creates a new redirection host.

func (*Client) CreateStream

func (c *Client) CreateStream(ctx context.Context, stream *Stream) (*Stream, error)

CreateStream creates a new stream.

func (*Client) DeleteAccessList

func (c *Client) DeleteAccessList(ctx context.Context, id int) error

DeleteAccessList deletes an access list.

func (*Client) DeleteCertificate

func (c *Client) DeleteCertificate(ctx context.Context, id int) error

DeleteCertificate deletes a certificate.

func (*Client) DeleteDeadHost

func (c *Client) DeleteDeadHost(ctx context.Context, id int) error

DeleteDeadHost deletes a dead host.

func (*Client) DeleteProxyHost

func (c *Client) DeleteProxyHost(ctx context.Context, id int) error

DeleteProxyHost deletes a proxy host.

func (*Client) DeleteRedirectionHost

func (c *Client) DeleteRedirectionHost(ctx context.Context, id int) error

DeleteRedirectionHost deletes a redirection host.

func (*Client) DeleteStream

func (c *Client) DeleteStream(ctx context.Context, id int) error

DeleteStream deletes a stream.

func (*Client) DisableProxyHost

func (c *Client) DisableProxyHost(ctx context.Context, id int) error

DisableProxyHost disables a proxy host.

func (*Client) EnableProxyHost

func (c *Client) EnableProxyHost(ctx context.Context, id int) error

EnableProxyHost enables a proxy host.

func (*Client) GetAccessList

func (c *Client) GetAccessList(ctx context.Context, id int) (*AccessList, error)

GetAccessList returns an access list by ID.

func (*Client) GetCertificate

func (c *Client) GetCertificate(ctx context.Context, id int) (*Certificate, error)

GetCertificate returns a certificate by ID.

func (*Client) GetHostsCount

func (c *Client) GetHostsCount(ctx context.Context) (*HostsCount, error)

GetHostsCount returns the count of hosts by type.

func (*Client) GetProxyHost

func (c *Client) GetProxyHost(ctx context.Context, id int) (*ProxyHost, error)

GetProxyHost returns a proxy host by ID.

func (*Client) GetRedirectionHost

func (c *Client) GetRedirectionHost(ctx context.Context, id int) (*RedirectionHost, error)

GetRedirectionHost returns a redirection host by ID.

func (*Client) GetSettings

func (c *Client) GetSettings(ctx context.Context) ([]*Setting, error)

GetSettings returns all settings.

func (*Client) GetStream

func (c *Client) GetStream(ctx context.Context, id int) (*Stream, error)

GetStream returns a stream by ID.

func (*Client) Health

func (c *Client) Health(ctx context.Context) error

Health checks if NPM is healthy.

func (*Client) ListAccessLists

func (c *Client) ListAccessLists(ctx context.Context) ([]*AccessList, error)

ListAccessLists returns all access lists.

func (*Client) ListCertificates

func (c *Client) ListCertificates(ctx context.Context) ([]*Certificate, error)

ListCertificates returns all certificates.

func (*Client) ListDeadHosts

func (c *Client) ListDeadHosts(ctx context.Context) ([]*DeadHost, error)

ListDeadHosts returns all dead hosts.

func (*Client) ListProxyHosts

func (c *Client) ListProxyHosts(ctx context.Context) ([]*ProxyHost, error)

ListProxyHosts returns all proxy hosts.

func (*Client) ListRedirectionHosts

func (c *Client) ListRedirectionHosts(ctx context.Context) ([]*RedirectionHost, error)

ListRedirectionHosts returns all redirection hosts.

func (*Client) ListStreams

func (c *Client) ListStreams(ctx context.Context) ([]*Stream, error)

ListStreams returns all streams.

func (*Client) ReloadNginx

func (c *Client) ReloadNginx(ctx context.Context) error

ReloadNginx reloads the nginx configuration.

func (*Client) RenewCertificate

func (c *Client) RenewCertificate(ctx context.Context, id int) (*Certificate, error)

RenewCertificate renews a certificate.

func (*Client) RequestLetsEncryptCertificate

func (c *Client) RequestLetsEncryptCertificate(ctx context.Context, req *CertificateRequest) (*Certificate, error)

RequestLetsEncryptCertificate requests a new Let's Encrypt certificate.

func (*Client) UpdateAccessList

func (c *Client) UpdateAccessList(ctx context.Context, id int, list *AccessList) (*AccessList, error)

UpdateAccessList updates an existing access list.

func (*Client) UpdateProxyHost

func (c *Client) UpdateProxyHost(ctx context.Context, id int, host *ProxyHost) (*ProxyHost, error)

UpdateProxyHost updates an existing proxy host.

func (*Client) UpdateRedirectionHost

func (c *Client) UpdateRedirectionHost(ctx context.Context, id int, host *RedirectionHost) (*RedirectionHost, error)

UpdateRedirectionHost updates an existing redirection host.

func (*Client) UpdateSetting

func (c *Client) UpdateSetting(ctx context.Context, id string, value interface{}) (*Setting, error)

UpdateSetting updates a setting.

func (*Client) UpdateStream

func (c *Client) UpdateStream(ctx context.Context, id int, stream *Stream) (*Stream, error)

UpdateStream updates an existing stream.

func (*Client) UploadCustomCertificate

func (c *Client) UploadCustomCertificate(ctx context.Context, niceName string, cert, key, intermediate []byte) (*Certificate, error)

UploadCustomCertificate uploads a custom SSL certificate to NPM.

type Config

type Config struct {
	BaseURL  string // e.g., "http://npm:81"
	Email    string // NPM admin email
	Password string // NPM admin password
	Timeout  time.Duration
}

Config holds the NPM client configuration.

type ConnectionCreate

type ConnectionCreate = models.NPMConnectionCreate

ConnectionCreate is an alias for models.NPMConnectionCreate.

type ConnectionUpdate

type ConnectionUpdate = models.NPMConnectionUpdate

ConnectionUpdate is an alias for models.NPMConnectionUpdate.

type DeadHost

type DeadHost struct {
	ID             int                    `json:"id,omitempty"`
	CreatedOn      string                 `json:"created_on,omitempty"`
	ModifiedOn     string                 `json:"modified_on,omitempty"`
	DomainNames    []string               `json:"domain_names"`
	CertificateID  interface{}            `json:"certificate_id"`
	SSLForced      bool                   `json:"ssl_forced"`
	HSTSEnabled    bool                   `json:"hsts_enabled"`
	HSTSSubdomains bool                   `json:"hsts_subdomains"`
	HTTP2Support   bool                   `json:"http2_support"`
	AdvancedConfig string                 `json:"advanced_config"`
	Enabled        bool                   `json:"enabled"`
	Meta           map[string]interface{} `json:"meta,omitempty"`
	Certificate    *Certificate           `json:"certificate,omitempty"`
}

DeadHost represents an NPM dead host (404 page).

type HostsCount

type HostsCount struct {
	Proxy       int `json:"proxy"`
	Redirection int `json:"redirection"`
	Stream      int `json:"stream"`
	Dead        int `json:"dead"`
}

HostsCount represents the count of hosts by type.

type ProxyHost

type ProxyHost struct {
	ID                    int                    `json:"id,omitempty"`
	CreatedOn             string                 `json:"created_on,omitempty"`
	ModifiedOn            string                 `json:"modified_on,omitempty"`
	DomainNames           []string               `json:"domain_names"`
	ForwardScheme         string                 `json:"forward_scheme"`
	ForwardHost           string                 `json:"forward_host"`
	ForwardPort           int                    `json:"forward_port"`
	CertificateID         interface{}            `json:"certificate_id"` // int, "new", or null
	SSLForced             bool                   `json:"ssl_forced"`
	HSTSEnabled           bool                   `json:"hsts_enabled"`
	HSTSSubdomains        bool                   `json:"hsts_subdomains"`
	HTTP2Support          bool                   `json:"http2_support"`
	BlockExploits         bool                   `json:"block_exploits"`
	CachingEnabled        bool                   `json:"caching_enabled"`
	AllowWebsocketUpgrade bool                   `json:"allow_websocket_upgrade"`
	AccessListID          int                    `json:"access_list_id"`
	AdvancedConfig        string                 `json:"advanced_config"`
	Enabled               bool                   `json:"enabled"`
	Locations             []ProxyHostLocation    `json:"locations,omitempty"`
	Meta                  map[string]interface{} `json:"meta,omitempty"`
	// Expanded fields (when using ?expand=...)
	Certificate *Certificate `json:"certificate,omitempty"`
	AccessList  *AccessList  `json:"access_list,omitempty"`
}

ProxyHost represents an NPM proxy host.

type ProxyHostCreate

type ProxyHostCreate struct {
	DomainNames    []string    `json:"domain_names"`
	ForwardScheme  string      `json:"forward_scheme"`
	ForwardHost    string      `json:"forward_host"`
	ForwardPort    int         `json:"forward_port"`
	CertificateID  interface{} `json:"certificate_id,omitempty"`
	SSLForced      bool        `json:"ssl_forced,omitempty"`
	HSTSEnabled    bool        `json:"hsts_enabled,omitempty"`
	HSTSSubdomains bool        `json:"hsts_subdomains,omitempty"`
	HTTP2Support   bool        `json:"http2_support,omitempty"`
	BlockExploits  bool        `json:"block_exploits,omitempty"`
	CachingEnabled bool        `json:"caching_enabled,omitempty"`
	AllowWebsocket bool        `json:"allow_websocket_upgrade,omitempty"`
	AccessListID   int         `json:"access_list_id,omitempty"`
	AdvancedConfig string      `json:"advanced_config,omitempty"`
}

ProxyHostCreate is the input for creating a proxy host.

type ProxyHostLocation

type ProxyHostLocation struct {
	Path           string `json:"path"`
	ForwardScheme  string `json:"forward_scheme,omitempty"`
	ForwardHost    string `json:"forward_host,omitempty"`
	ForwardPort    int    `json:"forward_port,omitempty"`
	AdvancedConfig string `json:"advanced_config,omitempty"`
}

ProxyHostLocation represents a custom location in a proxy host.

type ProxyHostUpdate

type ProxyHostUpdate struct {
	DomainNames    []string    `json:"domain_names,omitempty"`
	ForwardScheme  *string     `json:"forward_scheme,omitempty"`
	ForwardHost    *string     `json:"forward_host,omitempty"`
	ForwardPort    *int        `json:"forward_port,omitempty"`
	CertificateID  interface{} `json:"certificate_id,omitempty"`
	SSLForced      *bool       `json:"ssl_forced,omitempty"`
	HSTSEnabled    *bool       `json:"hsts_enabled,omitempty"`
	HSTSSubdomains *bool       `json:"hsts_subdomains,omitempty"`
	HTTP2Support   *bool       `json:"http2_support,omitempty"`
	BlockExploits  *bool       `json:"block_exploits,omitempty"`
	CachingEnabled *bool       `json:"caching_enabled,omitempty"`
	AllowWebsocket *bool       `json:"allow_websocket_upgrade,omitempty"`
	AccessListID   *int        `json:"access_list_id,omitempty"`
	AdvancedConfig *string     `json:"advanced_config,omitempty"`
	Enabled        *bool       `json:"enabled,omitempty"`
}

ProxyHostUpdate is the input for updating a proxy host.

type RedirectionCreate

type RedirectionCreate struct {
	DomainNames     []string    `json:"domain_names"`
	ForwardScheme   string      `json:"forward_scheme"`
	ForwardDomain   string      `json:"forward_domain_name"`
	ForwardHTTPCode int         `json:"forward_http_code"`
	PreservePath    bool        `json:"preserve_path"`
	CertificateID   interface{} `json:"certificate_id,omitempty"`
	SSLForced       bool        `json:"ssl_forced,omitempty"`
	HSTSEnabled     bool        `json:"hsts_enabled,omitempty"`
	HSTSSubdomains  bool        `json:"hsts_subdomains,omitempty"`
	HTTP2Support    bool        `json:"http2_support,omitempty"`
	BlockExploits   bool        `json:"block_exploits,omitempty"`
	AdvancedConfig  string      `json:"advanced_config,omitempty"`
}

RedirectionCreate is the input for creating a redirection host.

type RedirectionHost

type RedirectionHost struct {
	ID                int                    `json:"id,omitempty"`
	CreatedOn         string                 `json:"created_on,omitempty"`
	ModifiedOn        string                 `json:"modified_on,omitempty"`
	DomainNames       []string               `json:"domain_names"`
	ForwardScheme     string                 `json:"forward_scheme"`
	ForwardDomainName string                 `json:"forward_domain_name"`
	ForwardHTTPCode   int                    `json:"forward_http_code"`
	PreservePath      bool                   `json:"preserve_path"`
	CertificateID     interface{}            `json:"certificate_id"`
	SSLForced         bool                   `json:"ssl_forced"`
	HSTSEnabled       bool                   `json:"hsts_enabled"`
	HSTSSubdomains    bool                   `json:"hsts_subdomains"`
	HTTP2Support      bool                   `json:"http2_support"`
	BlockExploits     bool                   `json:"block_exploits"`
	AdvancedConfig    string                 `json:"advanced_config"`
	Enabled           bool                   `json:"enabled"`
	Meta              map[string]interface{} `json:"meta,omitempty"`
	Certificate       *Certificate           `json:"certificate,omitempty"`
}

RedirectionHost represents an NPM redirection host.

type Service

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

Service provides NPM integration functionality.

func NewService

func NewService(
	npmConnRepo *postgres.NPMConnectionRepository,
	mappingRepo *postgres.ContainerProxyMappingRepository,
	auditRepo *postgres.NPMAuditLogRepository,
	encryptor *crypto.AESEncryptor,
	logger *zap.Logger,
) *Service

NewService creates a new NPM integration service.

func (*Service) AutoConnect

func (s *Service) AutoConnect(ctx context.Context, hostID, baseURL, email, password, userID string) (bool, error)

StartHealthCheckWorker starts a background worker to check NPM health. AutoConnect attempts to establish an NPM connection from config credentials. If a connection already exists for the hostID, it verifies/updates it. Returns true if connection is active and healthy.

func (*Service) CheckHealth

func (s *Service) CheckHealth(ctx context.Context, hostID string) (bool, error)

CheckHealth checks if the NPM instance for a host is healthy.

func (*Service) ConfigureConnection

func (s *Service) ConfigureConnection(ctx context.Context, hostID string, create *ConnectionCreate, userID string) (*models.NPMConnection, error)

ConfigureConnection configures NPM connection for a Docker host.

func (*Service) CreateAccessList

func (s *Service) CreateAccessList(ctx context.Context, hostID string, list *AccessListCreate, userID string) (*AccessList, error)

CreateAccessList creates a new access list in NPM.

func (*Service) CreateAutoProxy

func (s *Service) CreateAutoProxy(ctx context.Context, hostID string, config *models.AutoProxyConfig, userID string) (*ProxyHost, error)

CreateAutoProxy creates an NPM proxy host from container configuration.

func (*Service) CreateProxyHost

func (s *Service) CreateProxyHost(ctx context.Context, hostID string, host *ProxyHostCreate, userID string) (*ProxyHost, error)

CreateProxyHost creates a new proxy host in NPM.

func (*Service) CreateRedirection

func (s *Service) CreateRedirection(ctx context.Context, hostID string, redir *RedirectionCreate, userID string) (*RedirectionHost, error)

CreateRedirection creates a new redirection in NPM.

func (*Service) DeleteAccessList

func (s *Service) DeleteAccessList(ctx context.Context, hostID string, listID int, userID string) error

DeleteAccessList deletes an access list from NPM.

func (*Service) DeleteAutoProxy

func (s *Service) DeleteAutoProxy(ctx context.Context, hostID, containerID string, userID string) error

DeleteAutoProxy deletes an auto-proxy when container is removed.

func (*Service) DeleteCertificate

func (s *Service) DeleteCertificate(ctx context.Context, hostID string, certID int) error

DeleteCertificate deletes a certificate from NPM.

func (*Service) DeleteConnection

func (s *Service) DeleteConnection(ctx context.Context, id string) error

DeleteConnection deletes the NPM connection for a Docker host.

func (*Service) DeleteProxyHost

func (s *Service) DeleteProxyHost(ctx context.Context, hostID string, proxyID int, userID string) error

DeleteProxyHost deletes a proxy host from NPM.

func (*Service) DeleteRedirection

func (s *Service) DeleteRedirection(ctx context.Context, hostID string, redirID int, userID string) error

DeleteRedirection deletes a redirection from NPM.

func (*Service) DisableProxyHost

func (s *Service) DisableProxyHost(ctx context.Context, hostID string, proxyID int, userID string) error

DisableProxyHost disables a proxy host in NPM.

func (*Service) EnableProxyHost

func (s *Service) EnableProxyHost(ctx context.Context, hostID string, proxyID int, userID string) error

EnableProxyHost enables a proxy host in NPM.

func (*Service) ExtractProxyConfig

func (s *Service) ExtractProxyConfig(containerInfo *container.InspectResponse) *models.AutoProxyConfig

ExtractProxyConfig extracts auto-proxy configuration from container labels.

func (*Service) GetAuditLogs

func (s *Service) GetAuditLogs(ctx context.Context, hostID string, limit, offset int) ([]*models.NPMAuditLog, int, error)

GetAuditLogs returns audit logs for a host.

func (*Service) GetClient

func (s *Service) GetClient(ctx context.Context, hostID string) (*Client, error)

GetClient returns the NPM client for a Docker host.

func (*Service) GetConnection

func (s *Service) GetConnection(ctx context.Context, hostID string) (*models.NPMConnection, error)

GetConnection gets the NPM connection for a Docker host.

func (*Service) GetContainerMappings

func (s *Service) GetContainerMappings(ctx context.Context, hostID string) ([]*models.ContainerProxyMapping, error)

GetContainerMappings returns all container-proxy mappings for a host.

func (*Service) GetProxyHost

func (s *Service) GetProxyHost(ctx context.Context, hostID string, proxyID int) (*ProxyHost, error)

GetProxyHost returns a proxy host by ID.

func (*Service) ListAccessLists

func (s *Service) ListAccessLists(ctx context.Context, hostID string) ([]*AccessList, error)

ListAccessLists returns all access lists from NPM.

func (*Service) ListAuditLogs

func (s *Service) ListAuditLogs(ctx context.Context, hostID string, limit, offset int) ([]*models.NPMAuditLog, int, error)

ListAuditLogs returns NPM audit logs for a host.

func (*Service) ListCertificates

func (s *Service) ListCertificates(ctx context.Context, hostID string) ([]*Certificate, error)

ListCertificates returns all certificates from NPM.

func (*Service) ListProxyHosts

func (s *Service) ListProxyHosts(ctx context.Context, hostID string) ([]*ProxyHost, error)

ListProxyHosts returns all proxy hosts from NPM.

func (*Service) ListRedirections

func (s *Service) ListRedirections(ctx context.Context, hostID string) ([]*RedirectionHost, error)

ListRedirections returns all redirections from NPM.

func (*Service) RequestLetsEncrypt

func (s *Service) RequestLetsEncrypt(ctx context.Context, hostID string, domainNames []string, email string) (*Certificate, error)

RequestLetsEncrypt requests a Let's Encrypt certificate.

func (*Service) StartHealthCheckWorker

func (s *Service) StartHealthCheckWorker(ctx context.Context, interval time.Duration)

func (*Service) TestConnection

func (s *Service) TestConnection(ctx context.Context, hostID string) error

TestConnection tests the NPM connection.

func (*Service) UpdateAutoProxy

func (s *Service) UpdateAutoProxy(ctx context.Context, hostID string, config *models.AutoProxyConfig, userID string) (*ProxyHost, error)

UpdateAutoProxy updates an existing auto-proxy.

func (*Service) UpdateConnection

func (s *Service) UpdateConnection(ctx context.Context, id string, update *ConnectionUpdate, userID string) (*models.NPMConnection, error)

UpdateConnection updates the NPM connection for a Docker host.

func (*Service) UpdateProxyHost

func (s *Service) UpdateProxyHost(ctx context.Context, hostID string, proxyID int, host *ProxyHostUpdate, userID string) (*ProxyHost, error)

UpdateProxyHost updates a proxy host in NPM.

type Setting

type Setting struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Value       interface{}            `json:"value"`
	Meta        map[string]interface{} `json:"meta"`
}

Setting represents an NPM setting.

type Stream

type Stream struct {
	ID             int                    `json:"id,omitempty"`
	CreatedOn      string                 `json:"created_on,omitempty"`
	ModifiedOn     string                 `json:"modified_on,omitempty"`
	IncomingPort   int                    `json:"incoming_port"`
	ForwardingHost string                 `json:"forwarding_host"`
	ForwardingPort int                    `json:"forwarding_port"`
	TCPForwarding  bool                   `json:"tcp_forwarding"`
	UDPForwarding  bool                   `json:"udp_forwarding"`
	CertificateID  interface{}            `json:"certificate_id"`
	Enabled        bool                   `json:"enabled"`
	Meta           map[string]interface{} `json:"meta,omitempty"`
	Certificate    *Certificate           `json:"certificate,omitempty"`
}

Stream represents an NPM stream.

type TokenResponse

type TokenResponse struct {
	Token   string `json:"token"`
	Expires string `json:"expires"`
}

TokenResponse represents the NPM token response.

Jump to

Keyboard shortcuts

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