parsing

package
v0.0.0-...-39aa7b3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_lib_goadblock_src_adblock_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AdblockEngine

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

func NewAdblockEngine

func NewAdblockEngine(log *log.Logger) (*AdblockEngine, error)

func (*AdblockEngine) Close

func (engine *AdblockEngine) Close()

func (*AdblockEngine) Filter

func (engine *AdblockEngine) Filter(ids []string, classes []string, urls []string, baseUrl string) ([]string, []string, error)

type Engine

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

func NewEngine

func NewEngine(log *log.Logger) (*Engine, error)

func (*Engine) Close

func (engine *Engine) Close()

func (*Engine) HtmlToText

func (engine *Engine) HtmlToText(z *html.Node) ([]*serialize.FlatNode, string, string, error)

func (*Engine) IdentifyElements

func (engine *Engine) IdentifyElements(z *html.Node, baseUrl string, adblock *AdblockEngine) (*ParseAnalysis, error)

type FilterRequest

type FilterRequest struct {
	Classes []string `protobuf:"bytes,1,rep,name=classes,proto3" json:"classes,omitempty"`
	Ids     []string `protobuf:"bytes,2,rep,name=ids,proto3" json:"ids,omitempty"`
	Urls    []string `protobuf:"bytes,3,rep,name=urls,proto3" json:"urls,omitempty"`
	BaseUrl string   `protobuf:"bytes,4,opt,name=base_url,json=baseUrl,proto3" json:"base_url,omitempty"`
	// contains filtered or unexported fields
}

func (*FilterRequest) Descriptor deprecated

func (*FilterRequest) Descriptor() ([]byte, []int)

Deprecated: Use FilterRequest.ProtoReflect.Descriptor instead.

func (*FilterRequest) GetBaseUrl

func (x *FilterRequest) GetBaseUrl() string

func (*FilterRequest) GetClasses

func (x *FilterRequest) GetClasses() []string

func (*FilterRequest) GetIds

func (x *FilterRequest) GetIds() []string

func (*FilterRequest) GetUrls

func (x *FilterRequest) GetUrls() []string

func (*FilterRequest) ProtoMessage

func (*FilterRequest) ProtoMessage()

func (*FilterRequest) ProtoReflect

func (x *FilterRequest) ProtoReflect() protoreflect.Message

func (*FilterRequest) Reset

func (x *FilterRequest) Reset()

func (*FilterRequest) String

func (x *FilterRequest) String() string

type FilterResponse

type FilterResponse struct {
	Matches        []string `protobuf:"bytes,1,rep,name=matches,proto3" json:"matches,omitempty"`
	BlockedDomains []string `protobuf:"bytes,2,rep,name=blocked_domains,json=blockedDomains,proto3" json:"blocked_domains,omitempty"`
	// contains filtered or unexported fields
}

func (*FilterResponse) Descriptor deprecated

func (*FilterResponse) Descriptor() ([]byte, []int)

Deprecated: Use FilterResponse.ProtoReflect.Descriptor instead.

func (*FilterResponse) GetBlockedDomains

func (x *FilterResponse) GetBlockedDomains() []string

func (*FilterResponse) GetMatches

func (x *FilterResponse) GetMatches() []string

func (*FilterResponse) ProtoMessage

func (*FilterResponse) ProtoMessage()

func (*FilterResponse) ProtoReflect

func (x *FilterResponse) ProtoReflect() protoreflect.Message

func (*FilterResponse) Reset

func (x *FilterResponse) Reset()

func (*FilterResponse) String

func (x *FilterResponse) String() string

type ParseAnalysis

type ParseAnalysis struct {
	Ids     []string
	Classes []string
	Urls    []string
	Links   []string

	BadUrls       []string
	BadElements   []string
	BadLinkTitles []string
}

type RuleGroups

type RuleGroups struct {
	Filters []*Rules `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"`
	// contains filtered or unexported fields
}

func (*RuleGroups) Descriptor deprecated

func (*RuleGroups) Descriptor() ([]byte, []int)

Deprecated: Use RuleGroups.ProtoReflect.Descriptor instead.

func (*RuleGroups) GetFilters

func (x *RuleGroups) GetFilters() []*Rules

func (*RuleGroups) ProtoMessage

func (*RuleGroups) ProtoMessage()

func (*RuleGroups) ProtoReflect

func (x *RuleGroups) ProtoReflect() protoreflect.Message

func (*RuleGroups) Reset

func (x *RuleGroups) Reset()

func (*RuleGroups) String

func (x *RuleGroups) String() string

type Rules

type Rules struct {
	Rules []string `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"`
	// contains filtered or unexported fields
}

func (*Rules) Descriptor deprecated

func (*Rules) Descriptor() ([]byte, []int)

Deprecated: Use Rules.ProtoReflect.Descriptor instead.

func (*Rules) GetRules

func (x *Rules) GetRules() []string

func (*Rules) ProtoMessage

func (*Rules) ProtoMessage()

func (*Rules) ProtoReflect

func (x *Rules) ProtoReflect() protoreflect.Message

func (*Rules) Reset

func (x *Rules) Reset()

func (*Rules) String

func (x *Rules) String() string

type SimpleNode

type SimpleNode struct {
	Type     SimpleNodeType
	Text     string
	Children []*SimpleNode
}

func (*SimpleNode) String

func (node *SimpleNode) String() string

type SimpleNodeType

type SimpleNodeType string

Jump to

Keyboard shortcuts

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