converters

package
v0.0.0-...-a1bc676 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 6

README

Package cloudeng.io/glean/crawlindex/converters

import cloudeng.io/glean/crawlindex/converters

Constants

GleanDocumentType, GleanUserType
GleanDocumentType = content.Type("glean/document")
GleanUserType = content.Type("glean/user")

Functions

Func CreateDocumentRegistry
func CreateDocumentRegistry(converters ...Document) (*content.Registry[Document], error)
Func CreateUserRegistry
func CreateUserRegistry(converters ...User) (*content.Registry[User], error)
Func IgnoreContentType
func IgnoreContentType(ctype content.Type) error
Func IsIgnoreContentType
func IsIgnoreContentType(err error) bool

Types

Type Document
type Document interface {
	Type() content.Type
	Convert(ctx context.Context, datasource string, cfg config.Conversion, ctype content.Type, data []byte) (gleansdk.DocumentDefinition, error)
}
Functions
func NewHTML() Document

NewHTML returns a new install of HTML.

Type HTML
type HTML struct{}

HTML represents an html to glean document converter.

Methods
func (cnv *HTML) Convert(_ context.Context, datasource string, cfg config.Conversion, ctype content.Type, data []byte) (gleansdk.DocumentDefinition, error)
func (cnv *HTML) Type() content.Type
Type User
type User interface {
	Type() content.Type
	Convert(ctx context.Context, datasource string, cfg config.Conversion, ctype content.Type, data []byte) (gleansdk.DatasourceUserDefinition, error)
}

Documentation

Index

Constants

View Source
const (
	GleanDocumentType = content.Type("glean/document")
	GleanUserType     = content.Type("glean/user")
)

Variables

This section is empty.

Functions

func CreateDocumentRegistry

func CreateDocumentRegistry(converters ...Document) (*content.Registry[Document], error)

func CreateUserRegistry

func CreateUserRegistry(converters ...User) (*content.Registry[User], error)

func IgnoreContentType

func IgnoreContentType(ctype content.Type) error

func IsIgnoreContentType

func IsIgnoreContentType(err error) bool

Types

type Document

type Document interface {
	Type() content.Type
	Convert(ctx context.Context, datasource string, cfg config.Conversion, ctype content.Type, data []byte) (gleansdk.DocumentDefinition, error)
}

func NewHTML

func NewHTML() Document

NewHTML returns a new install of HTML.

type HTML

type HTML struct{}

HTML represents an html to glean document converter.

func (*HTML) Convert

func (cnv *HTML) Convert(_ context.Context, datasource string, cfg config.Conversion, ctype content.Type, data []byte) (gleansdk.DocumentDefinition, error)

func (*HTML) Type

func (cnv *HTML) Type() content.Type

type User

type User interface {
	Type() content.Type
	Convert(ctx context.Context, datasource string, cfg config.Conversion, ctype content.Type, data []byte) (gleansdk.DatasourceUserDefinition, error)
}

Jump to

Keyboard shortcuts

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