parser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SliceAsCSV

func SliceAsCSV(slice []string) string

SliceAsCSV converts slice to string separated by ,

Types

type Domain

type Domain struct {
	Name        string // e.g. example.com
	IsFileFound bool
	IsFileValid bool
	Result      SecTXTFile
	Complete    bool
	StatusCode  string
	Error       string
}

Domain struct shows whether a domain name has a security.txt file or not. If it does, include the Result struct too.

func (Domain) JSONExport

func (d Domain) JSONExport() ([]byte, error)

JSONExport transforms SecTXTFile into JSON

func (Domain) PrettyPrint

func (d Domain) PrettyPrint()

PrettyPrint is a method for calling on declared structs

type SecTXTFile

type SecTXTFile struct {
	//Comments        string // e.g. # This is a comment
	Acknowledgments    string   // e.g. https://example.com/halloffame
	Canonical          string   // e.g. https://example.com/.well-known/security.txt
	Contact            []string // e.g. https://example.com/security or mailto:security@example.com
	Encryption         string   // e.g. https://example.com/publickey.txt
	Expires            string   // e.g. Expires: 2021-12-31T18:37:07z
	Hiring             string   // e.g. https://example.com/careers
	Policy             string   // e.g. https://example.com/disclosure.html
	PreferredLanguages []string // e.g. en, es, fr
}

SecTXTFile struct for security.txt file

func ParseSecTXT

func ParseSecTXT(r []byte) *SecTXTFile

ParseSecTXT using switch statement instead

Jump to

Keyboard shortcuts

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