Documentation
¶
Index ¶
- Constants
- type Asset
- type AssetClassifier
- func (a *AssetClassifier) AssetType() (AssetType, cenclierrors.CencliError)
- func (a *AssetClassifier) CertificateIDs() []CertificateID
- func (a *AssetClassifier) HostIDs() []HostID
- func (a *AssetClassifier) KnownAssetCount() int
- func (a *AssetClassifier) KnownAssetIDs() []string
- func (a *AssetClassifier) UnknownAssets() []string
- func (a *AssetClassifier) WebPropertyIDs() []WebPropertyID
- type AssetType
- type Certificate
- type CertificateID
- type Host
- type HostID
- type InvalidAssetIDError
- type MixedAssetTypesError
- type NoAssetsError
- type TooManyAssetsError
- type WebProperty
- type WebPropertyID
Constants ¶
const DefaultWebPropertyPort = 443
DefaultWebPropertyPort is the default port that will be used if no port is specified in the input.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssetClassifier ¶
type AssetClassifier struct {
// contains filtered or unexported fields
}
AssetClassifier classifies raw string inputs into typed asset identifiers and reports errors. It also deduplicates values within each asset category.
func NewAssetClassifier ¶
func NewAssetClassifier(rawAssets ...string) *AssetClassifier
NewAssetClassifier creates a classifier and immediately classifies the provided raw assets.
func (*AssetClassifier) AssetType ¶
func (a *AssetClassifier) AssetType() (AssetType, cenclierrors.CencliError)
AssetType returns the type of assets that were passed to the classifier. If no assets were passed, it returns AssetTypeUnknown. If multiple asset types were passed, it returns a MixedAssetTypesError.
func (*AssetClassifier) CertificateIDs ¶
func (a *AssetClassifier) CertificateIDs() []CertificateID
func (*AssetClassifier) HostIDs ¶
func (a *AssetClassifier) HostIDs() []HostID
func (*AssetClassifier) KnownAssetCount ¶
func (a *AssetClassifier) KnownAssetCount() int
KnownAssetCount returns the number of known asset types that were passed to the classifier.
func (*AssetClassifier) KnownAssetIDs ¶
func (a *AssetClassifier) KnownAssetIDs() []string
KnownAssetIDs returns the IDs of the known asset types that were passed to the classifier.
func (*AssetClassifier) UnknownAssets ¶
func (a *AssetClassifier) UnknownAssets() []string
func (*AssetClassifier) WebPropertyIDs ¶
func (a *AssetClassifier) WebPropertyIDs() []WebPropertyID
type AssetType ¶
type AssetType string
AssetType represents the inferred type for a given collection of user-supplied assets. Supported values are "host", "certificate", and "webproperty".
type Certificate ¶
type Certificate struct{ components.Certificate }
Certificate represents a certificate asset. This has 1:1 correspondence with the SDK's Certificate type.
func NewCertificate ¶
func NewCertificate(cert components.Certificate) Certificate
func (Certificate) AssetType ¶
func (c Certificate) AssetType() AssetType
type CertificateID ¶
type CertificateID struct {
// contains filtered or unexported fields
}
CertificateID represents a validated SHA-256 hex string (64 chars).
func NewCertificateFingerprint ¶
func NewCertificateFingerprint(raw string) (CertificateID, error)
NewCertificateFingerprint parses a sha256 hex string into a CertificateID.
func (CertificateID) String ¶
func (c CertificateID) String() string
type Host ¶
type Host struct {
components.Host
MatchedServices []components.MatchedService `json:"matched_services,omitempty"`
}
Host represents a host asset. This has 1:1 correspondence with the SDK's Host type.
func NewHost ¶
func NewHost(host components.Host) Host
func NewHostWithMatchedServices ¶
func NewHostWithMatchedServices(host components.Host, matchedServices []components.MatchedService) Host
type HostID ¶
type HostID struct {
// contains filtered or unexported fields
}
HostID represents a validated IP address (v4 or v6).
type InvalidAssetIDError ¶
type InvalidAssetIDError interface {
cenclierrors.CencliError
}
InvalidAssetIDError represents an error that occurs when an invalid asset ID is provided.
func NewInvalidAssetIDError ¶
func NewInvalidAssetIDError(assetID string, reason string) InvalidAssetIDError
type MixedAssetTypesError ¶
type MixedAssetTypesError interface {
cenclierrors.CencliError
}
MixedAssetTypesError represents an error that occurs when mixed asset types are provided.
func NewMixedAssetTypesError ¶
func NewMixedAssetTypesError(typesFound ...AssetType) MixedAssetTypesError
type NoAssetsError ¶
type NoAssetsError interface {
cenclierrors.CencliError
}
NoAssetsError represents an error that occurs when no assets are provided.
func NewNoAssetsError ¶
func NewNoAssetsError() NoAssetsError
type TooManyAssetsError ¶
type TooManyAssetsError interface {
cenclierrors.CencliError
}
func NewTooManyAssetsError ¶
func NewTooManyAssetsError(provided int, supported int) TooManyAssetsError
type WebProperty ¶
type WebProperty struct{ components.Webproperty }
WebProperty represents a web property asset. This has 1:1 correspondence with the SDK's Webproperty type.
func NewWebProperty ¶
func NewWebProperty(webProperty components.Webproperty) WebProperty
func (WebProperty) AssetType ¶
func (w WebProperty) AssetType() AssetType
type WebPropertyID ¶
WebPropertyID represents a hostname:port tuple.
func NewWebPropertyID ¶
func NewWebPropertyID(raw string, defaultPort int) (WebPropertyID, error)
NewWebPropertyID parses a hostname:port string into a WebPropertyID. Supports refanged URLs with http:// or https:// prefixes. Hostnames that are not IP addresses must have a period. Handles IPv6 addresses with or without brackets. For compressed IPv6 addresses (containing ::) that end with a numeric segment that could be a port (e.g., ::1:8080), an error is returned to avoid ambiguity. Use brackets to disambiguate. If no port is specified, defaultPort is used.
func (WebPropertyID) String ¶
func (w WebPropertyID) String() string