Documentation ¶
Index ¶
- Variables
- func GetTags(ctx context.Context, source string, contentType ContentType, limit int, ...) ([]*processor.Tag, error)deprecated
- func GetTagsFromString(input string, contentType ContentType, limit int, verbose, noStopWords bool) ([]*processor.Tag, error)
- func GetTagsWithQuery(ctx context.Context, source, query string, contentType ContentType, limit int, ...) ([]*processor.Tag, error)deprecated
- func Run(ctx context.Context, options ...Option) ([]*processor.Tag, error)
- func ToStrings(items []*processor.Tag) []string
- type ContentType
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Source sets target source. Source = func(source string) Option { return func(c *config) { c.source = source } } // Query sets CSS query for the target. Query = func(query string) Option { return func(c *config) { c.query = query } } // TargetType sets content type of the target. TargetType = func(contentType ContentType) Option { return func(c *config) { c.contentType = contentType } } // Limit sets cthe limit of tags for the target. Limit = func(limit int) Option { return func(c *config) { c.limit = limit } } // Verbose enables high verbosity. Verbose = func(verbose bool) Option { return func(c *config) { c.verbose = verbose } } // NoStopWords enables stop-words exclusion from the output. NoStopWords = func(noStopWords bool) Option { return func(c *config) { c.noStopWords = noStopWords } } )
Functions ¶
func GetTagsFromString ¶ added in v0.1.0
func GetTagsFromString(input string, contentType ContentType, limit int, verbose, noStopWords bool) ([]*processor.Tag, error)
GetTagsFromString produces slice of tags ordered by frequency and limited by limit.
func GetTagsWithQuery
deprecated
added in
v0.17.0
func GetTagsWithQuery(ctx context.Context, source, query string, contentType ContentType, limit int, verbose, noStopWords bool) ([]*processor.Tag, error)
GetTagsWithQuery produces slice of tags from "source" narrowed down to a CSS "query" ordered by frequency and limited by limit.
Deprecated: use tagify#Run instead.
Types ¶
type ContentType ¶ added in v0.2.0
type ContentType int
ContentType ...
const ( Unknown ContentType = iota Text HTML )
Content types
func ContentTypeOf ¶ added in v0.2.0
func ContentTypeOf(contentType string) ContentType
ContentTypeOf returns ContentType based on string value.
func (ContentType) String ¶ added in v0.2.0
func (contentType ContentType) String() string
String ...
Click to show internal directories.
Click to hide internal directories.