xray

package
v0.0.0-...-9a36425 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPostNotFound = errors.New("post xray not found")
)

Functions

func SanitizeContent

func SanitizeContent(data string) string

Types

type Config

type Config struct {
	GitHubToken string
	Endpoint    string
	UserAgent   string
}

type Post

type Post struct {
	Name        string            `json:"name,omitempty"`
	Content     string            `json:"content,omitempty"`
	Author      string            `json:"author,omitempty"`
	AuthorPhoto string            `json:"authorPhoto,omitempty"`
	AuthorURL   string            `json:"authorUrl,omitempty"`
	Date        time.Time         `json:"date,omitempty"`
	URL         string            `json:"url,omitempty"`
	Type        microformats.Type `json:"type,omitempty"`
	Private     bool              `json:"private,omitempty"`
}

func Parse

func Parse(data map[string]interface{}) *Post

type XRay

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

func NewXRay

func NewXRay(c *Config, log *zap.SugaredLogger) (*XRay, error)

func (*XRay) Fetch

func (x *XRay) Fetch(urlStr string) (*Post, interface{}, error)

func (*XRay) Parse

func (x *XRay) Parse(data map[string]interface{}) *Post

Jump to

Keyboard shortcuts

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