addongate

package
v4.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package addongate recognises the platform saying "this needs a paid add-on".

The site answers a gated write or device route with a real HTTP 402 and a JSON body naming the add-on, and (for a read, or an older deploy) with HTTP 200 and a soft marker `planLocked: true`. Neither is a success: a client that parses the 200 as an answer drops the events it just "sent" and applies an empty config. Callers turn both into one *Error, keep what they hold and back off.

Index

Constants

View Source
const BillingURL = "https://www.vulnetix.com/resolve/billing#addons"

BillingURL is where an add-on is bought.

Variables

This section is empty.

Functions

func DisplayName

func DisplayName(kind string) string

DisplayName is the name a person knows the add-on by.

func Is

func Is(err error) bool

Is reports whether err is, or wraps, an add-on denial.

Types

type Error

type Error struct {
	Method, Path string
	Status       int
	// Addon is AddonSubscription.kind from the body: soc_intelligence or
	// package_firewall. Empty when the site did not name one.
	Addon string
	// Soft is true when the denial arrived as HTTP 200 with planLocked.
	Soft bool
}

Error is a denial for a missing add-on (or a plan floor).

func FromResponse

func FromResponse(method, path string, status int, body []byte) *Error

FromResponse returns the denial a response carries, or nil. A 402 is always one; a 2xx is one when its JSON body has planLocked true. Any other status, and any body that is not that marker, is not a denial.

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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