parser

package
v0.0.0-...-858fc30 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGuid

func GetGuid(ss []string) string

func GetLatestDate

func GetLatestDate(dates []time.Time) time.Time

func GetRemoteFileLastModified

func GetRemoteFileLastModified(url string) (time.Time, error)

func Route

func Route(g *gin.Engine, p Parser, o *Options) gin.IRoutes

func ServeFeed

func ServeFeed(c *gin.Context, feed *feeds.Feed)

Types

type Option

type Option struct {
	Flag      string
	Value     interface{}
	Required  bool
	Default   string
	Help      string
	ShortFlag string
	Type      string
	IsPath    bool
}

type Options

type Options struct {
	OptionsList OptionsList
	Parser      Parser
}

func GetFullOptions

func GetFullOptions(p Parser) *Options

func (Options) AddFlags

func (o Options) AddFlags(f *flag.FlagSet)

func (*Options) Get

func (o *Options) Get(key string) interface{}

func (Options) GetHelp

func (o Options) GetHelp() string

func (*Options) ParseYaml

func (o *Options) ParseYaml(m map[string]any) error

type OptionsList

type OptionsList []*Option

func (OptionsList) Get

func (o OptionsList) Get(key string) (interface{}, error)

type Parser

type Parser interface {
	Parse(*Options) (*feeds.Feed, error)
	GetOptions() Options
	String() string
}

Jump to

Keyboard shortcuts

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