Documentation
¶
Index ¶
- func MaskSecret(secret string) string
- type Article
- type CacheItem
- type FeedDef
- type FeedDefCollection
- type FeedDefPage
- type Filter
- type FilterDef
- type FilterDefCollection
- type FilterPlugin
- type FilterProps
- type Output
- type OutputDef
- type OutputDefCollection
- type OutputPlugin
- type OutputProps
- type PluginSpec
- type PluginType
- type PropSpec
- type PropType
- type Quota
- type Spec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Article ¶
type Article struct {
FeedTitle string `json:"feedTitle,omitempty"`
Title string `json:"title,omitempty"`
Text string `json:"text,omitempty"`
Content string `json:"content,omitempty"`
Link string `json:"link,omitempty"`
Updated string `json:"updated,omitempty"`
UpdatedParsed *time.Time `json:"updatedParsed,omitempty"`
Published string `json:"published,omitempty"`
PublishedParsed *time.Time `json:"publishedParsed,omitempty"`
GUID string `json:"guid,omitempty"`
Meta map[string]interface{} `json:"meta,omitempty"`
Tags []string `json:"tags,omitempty"`
}
Article model structure.
type FeedDef ¶
type FeedDef struct {
// ID of feed (MD5 of the xmlUrl)
ID string `json:"id"`
// URL of the XML feed
XMLURL string `json:"xmlUrl"`
// URL of the feed website
HTMLURL *string `json:"htmlUrl,omitempty"`
// URL of the PubSubHubbud hub
HubURL *string `json:"hubUrl,omitempty"`
// Title of the Feed
Title string `json:"title"`
// Aggregation status
Status *string `json:"status,omitempty"`
// List of tags
Tags []string `json:"tags,omitempty"`
// Date of creation
Cdate time.Time `json:"cdate"`
// Date of modification
Mdate time.Time `json:"mdate"`
}
FeedDef object structure
type FeedDefCollection ¶
type FeedDefCollection []FeedDef
FeedDefCollection is a list of feed definition
type FeedDefPage ¶
type FeedDefPage struct {
Total int
Page int
Size int
Feeds FeedDefCollection
}
FeedDefPage is a page of feed definition
type Filter ¶
type Filter interface {
// DoFilter apply filter on the article.
// Returns true if the filter was applied
DoFilter(article *Article) (bool, error)
// Match test if article match with filter condition
Match(article *Article) bool
// GetDef returns filter definition
GetDef() FilterDef
}
Filter is the filter interface
type FilterDef ¶
type FilterDef struct {
ID string `json:"id"`
Alias string `json:"alias"`
Spec
Condition string `json:"condition"`
Props FilterProps `json:"props:omitempty"`
Enabled bool `json:"enabled"`
NbSuccess uint32 `json:"nbSuccess"`
NbError uint32 `json:"nbError"`
}
FilterDef contains filter definition
type FilterDefCollection ¶
type FilterDefCollection []*FilterDef
FilterDefCollection is an array of filter definition
type FilterPlugin ¶
type FilterPlugin interface {
// Build a filter
Build(def *FilterDef) (Filter, error)
// Spec returns plugin specs
Spec() Spec
}
FilterPlugin is the interface of an filter plugin
type FilterProps ¶
type FilterProps map[string]interface{}
FilterProps constain properties of a filter
type Output ¶
type Output interface {
// Send article to the output.
// Returns true if the article was sent
Send(article *Article) (bool, error)
// GetDef returns output definition
GetDef() OutputDef
}
Output is the output interface
type OutputDef ¶
type OutputDef struct {
ID string `json:"id"`
Alias string `json:"alias"`
Spec
Condition string `json:"condition"`
Props OutputProps `json:"props:omitempty"`
Filters FilterDefCollection `json:"filters"`
Enabled bool `json:"enabled"`
NbSuccess uint32 `json:"nbSuccess"`
NbError uint32 `json:"nbError"`
}
OutputDef contains output definition
type OutputDefCollection ¶
type OutputDefCollection []*OutputDef
OutputDefCollection is an array of output definition
type OutputPlugin ¶
type OutputPlugin interface {
// Build an output plugin
Build(def *OutputDef) (Output, error)
// Spec returns plugin specs
Spec() Spec
}
OutputPlugin is the interface of an output plugin
type OutputProps ¶
type OutputProps map[string]interface{}
OutputProps contains properties of an output
type PluginSpec ¶
type PluginSpec struct {
Type PluginType
Spec
}
PluginSpec contains plugins specifications
type PluginType ¶
type PluginType int
PluginType is the plugin type qualifier
const ( // OutputPluginType output plugin type OutputPluginType PluginType = iota // FilterPluginType filter plugin type FilterPluginType )