common

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUUID

func GetUUID(text string) string

Types

type AggregatorItem

type AggregatorItem interface {
	ToDoc() (*Doc, error)
}

type Author

type Author struct {
	Avatar string `json:"avatar"`
	Name   string `json:"name"`
	URL    string `json:"url"`
}

type Card

type Card struct {
	Type string `json:"type"`
	HTML string `json:"html"`
}

type Config

type Config struct {
	DBPath    string         `env:"DB_FILE" envDefault:"./empty.db"`
	Addr      string         `env:"ADDR" envDefault:":8080"`
	Username  string         `env:"USERNAME,required"`
	Password  string         `env:"PASSWORD,required,unset"`
	Mastodon  MastodonConfig `envPrefix:"TOOT_"`
	Twitter   TwitterConfig  `envPrefix:"TW_"`
	Rss       RssConfig      `envPrefix:"RSS_"`
	NoPolling bool           `env:"NO_POLLING"`
	Debug     bool           `env:"DEBUG"`
}

type Custom

type Custom struct {
	ID         string `json:"id"`
	ScreenName string `json:"screen_name"`
}

type DeleteList

type DeleteList struct {
	Docs []*DocID `json:"docs"`
}

type Doc

type Doc struct {
	ID            string   `json:"doc_id,omitempty"`
	Type          string   `json:"type"`
	Kind          string   `json:"kind"`
	Skey          string   `json:"skey"`
	SID           string   `json:"sid"`
	URL           string   `json:"url"`
	Feed          *Feed    `json:"feed"`
	Source        *Source  `json:"source"`
	Title         string   `json:"title"`
	Content       string   `json:"content"`
	Medias        []*Media `json:"medias,omitempty"`
	Card          *Card    `json:"card,omitempty"`
	Author        *Author  `json:"author,omitempty"`
	CreatedAt     int64    `json:"created_at"`
	Custom        *Custom  `json:"custom"`
	Published     int64    `json:"published"`
	IsRepost      bool     `json:"is_repost,omitempty"`
	IsFollowedTag bool     `json:"is_followed_tag,omitempty"`
}

type DocID

type DocID struct {
	ID string `json:"doc_id"`
}

type Feed

type Feed struct {
	URL  string `json:"url"`
	Desc string `json:"desc"`
	Name string `json:"name"`
}

type Folder added in v0.3.0

type Folder struct {
	ID      int      `json:"id,omitempty"`
	Type    string   `json:"type"`
	Fkey    string   `json:"fkey"`
	Title   string   `json:"title"`
	Sources []Source `json:"sources"`
	SumSubs int      `json:"sum_subs"`
}

func (*Folder) GetID added in v0.3.0

func (s *Folder) GetID() int

func (*Folder) SetID added in v0.3.0

func (s *Folder) SetID(id int)

type FoldersResponse added in v0.3.0

type FoldersResponse struct {
	Folders []*Folder `json:"folders"`
	Success bool      `json:"success"`
}

type MastodonConfig

type MastodonConfig struct {
	Username     string `env:"USERNAME"`
	Password     string `env:"PASSWORD"`
	HomeServer   string `env:"HOMESERVER"`
	ClientID     string `env:"CLIENTID"`
	ClientSecret string `env:"CLIENTSECRET"`
}

type Media

type Media struct {
	Type        string     `json:"type"`
	ContentType string     `json:"content_type"`
	URL         string     `json:"url"`
	Size        *MediaSize `json:"size"`
}

type MediaSize

type MediaSize struct {
	Width  int64   `json:"width"`
	Height int64   `json:"height"`
	Size   string  `json:"size"`
	Aspect float64 `json:"aspect"`
}

type More

type More struct {
	DocID string `json:"doc_id"`
	SID   string `json:"sid"`
	Skey  string `json:"skey"`
}

type RssConfig

type RssConfig struct {
	Interval int `env:"INTERVAL"`
}

type Source

type Source struct {
	SID    string `json:"sid"`
	URL    string `json:"url"`
	Name   string `json:"name"`
	Avatar string `json:"avatar"`
}

type Sub

type Sub struct {
	ID           int       `json:"id,omitempty"`
	Type         string    `json:"type"`
	Kind         string    `json:"kind"`
	Fkey         string    `json:"fkey"`
	Skey         string    `json:"skey"`
	Title        string    `json:"title"`
	URL          string    `json:"url"`
	Links        []*string `json:"links"`
	LastChecked  time.Time `json:"last_checked"`
	ETag         string    `json:"etag"`
	LastModified string    `json:"last_modified"`
}

func (*Sub) GetID

func (s *Sub) GetID() int

func (*Sub) SetID

func (s *Sub) SetID(id int)

type SubsResponse

type SubsResponse struct {
	Subs    []*Sub    `json:"subs"`
	Folders []*Folder `json:"folders"`
	Success bool      `json:"success"`
}

type Timeline

type Timeline struct {
	Docs      []*Doc `json:"docs"`
	TotalDocs int    `json:"total_docs"`
	Append    bool   `json:"append"`
	More      *More  `json:"more"`
	Success   bool   `json:"success"`
	Skey      string `json:"skey"`
	SID       string `json:"sid"`
}

type Toc

type Toc struct {
	Rows    []*TocRow `json:"rows"`
	Success bool      `json:"success"`
	Total   int       `json:"total"`
}

type TocRow

type TocRow struct {
	Kind string       `json:"kind"`
	Skey string       `json:"skey"`
	Name string       `json:"name"`
	Sum  int          `json:"sum"`
	Subs []*TocSubRow `json:"subs"`
}

type TocSubRow

type TocSubRow struct {
	Kind       string `json:"kind"`
	Skey       string `json:"skey"`
	SID        string `json:"sid"`
	Name       string `json:"name"`
	ParentName string `json:"parent_name"`
	Avatar     string `json:"avatar"`
	Sum        int    `json:"sum"`
}

type TwitterConfig

type TwitterConfig struct {
	ApiKey            string `env:"API_KEY"`
	ApiKeySecret      string `env:"API_KEY_SECRET"`
	AccessToken       string `env:"ACCESS_TOKEN"`
	AccessTokenSecret string `env:"ACCESS_TOKEN_SECRET"`
}

Jump to

Keyboard shortcuts

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