Full Mattermost server source with integrated Community Enterprise features. Includes vendor directory for offline/air-gapped builds. Structure: - enterprise-impl/: Enterprise feature implementations - enterprise-community/: Init files that register implementations - enterprise/: Bridge imports (community_imports.go) - vendor/: All dependencies for offline builds Build (online): go build ./cmd/mattermost Build (offline/air-gapped): go build -mod=vendor ./cmd/mattermost 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
42 lines
1.0 KiB
Go
42 lines
1.0 KiB
Go
package goose
|
|
|
|
import (
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
// Goose is the main entry point of the program
|
|
type Goose struct {
|
|
config Configuration
|
|
}
|
|
|
|
// New returns a new instance of the article extractor
|
|
func New(args ...string) Goose {
|
|
return Goose{
|
|
config: GetDefaultConfiguration(args...),
|
|
}
|
|
}
|
|
|
|
// NewWithConfig returns a new instance of the article extractor with configuration
|
|
func NewWithConfig(config Configuration) Goose {
|
|
return Goose{
|
|
config,
|
|
}
|
|
}
|
|
|
|
// ExtractFromURL follows the URL, fetches the HTML page and returns an article object
|
|
func (g Goose) ExtractFromURL(url string) (*Article, error) {
|
|
HtmlRequester := NewHtmlRequester(g.config)
|
|
html, err := HtmlRequester.fetchHTML(url)
|
|
if err != nil {
|
|
return nil, errors.Wrap(err, "could not get htnk from site")
|
|
}
|
|
cc := NewCrawler(g.config)
|
|
return cc.Crawl(html, url)
|
|
}
|
|
|
|
// ExtractFromRawHTML returns an article object from the raw HTML content
|
|
func (g Goose) ExtractFromRawHTML(RawHTML string, url string) (*Article, error) {
|
|
cc := NewCrawler(g.config)
|
|
return cc.Crawl(RawHTML, url)
|
|
}
|