securitytxt: github.com/tomnomnom/securitytxt Index | Files

package securitytxt

import "github.com/tomnomnom/securitytxt"

Index

Package Files

field.go file.go parse.go validators.go

type Field Uses

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

A Field is an option/value pair and its associated comments

func (Field) Comments Uses

func (f Field) Comments() []string

Comments returns the comments associated with a field

func (Field) String Uses

func (f Field) String() string

String returns the value of a field

type File Uses

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

A File represents a security.txt file

func FromReader Uses

func FromReader(r io.Reader) (*File, error)

FromReader returns a new *File, generated by parsing the contents of the provided io.Reader, and an error if any errors were encountered. More detail can be obtained by calling the returned *File's Errors() method

func (File) Acknowledgement Uses

func (f File) Acknowledgement() []Field

Acknowledgement returns a slice of acknowledgement values from the File

func (File) Comments Uses

func (f File) Comments() []string

Comments returns a slice of comments from the File

func (File) Contact Uses

func (f File) Contact() []Field

Contact returns a slice of contact values from the File

func (File) EmailContact Uses

func (f File) EmailContact() []Field

EmailContact returns any contact values that are valid email addresses

func (File) Encryption Uses

func (f File) Encryption() []Field

Encryption returns a slice of encryption URIs from the File

func (File) Errors Uses

func (f File) Errors() []error

Errors returns a slice of errors encountered during parsing

func (File) Fields Uses

func (f File) Fields(filter string) []Field

func (File) HasAcknowledgement Uses

func (f File) HasAcknowledgement() bool

HasAcknowledgement returns true if there is at least one acknowledgement value

func (File) HasEncryption Uses

func (f File) HasEncryption() bool

HasEncryption returns true if there is at least one encryption value

func (File) HasErrors Uses

func (f File) HasErrors() bool

HasErrors returns true if any errors occured during parsing

func (File) PhoneContact Uses

func (f File) PhoneContact() []Field

PhoneContact returns any contact values that are valid phone numbers

func (File) URIContact Uses

func (f File) URIContact() []Field

URIContact returns any contact values that are valid URIs

Package securitytxt imports 7 packages (graph). Updated 2020-07-16. Refresh now. Tools for package owners.