Documentation ¶
Index ¶
- Variables
- func Append(lc fx.Lifecycle, svc Service, logger log15.Logger)
- func Autoclose(w io.Closer, f func() error) (err error)
- func Compress(w io.Writer, msg msgp.Encodable) error
- func Decompress(r io.Reader, msg msgp.Decodable) error
- func DownloadGeoIP(dest, u string) error
- func Guess(filename string, content []byte) (types.Type, error)
- func GuessReader(filename string, reader io.Reader) (types.Type, io.Reader, error)
- func IsBinary(content []byte) bool
- func IsPrivateIP(ip net.IP) bool
- func IsTemp(e error) bool
- func IsTimeout(e error) bool
- func JSONEncoder(w io.Writer) *json.Encoder
- func JSONMarshal(v interface{}) ([]byte, error)
- func JSONString(v interface{}) string
- func NewHTTPCacheClient(timeout time.Duration, maxConns int, basePath string, retries int) *httpclient.Client
- func NewHTTPClient(timeout time.Duration, maxConns int, retries int) *httpclient.Client
- func NewStdinListener() net.Listener
- func NewULID() ulid.ULID
- func Normalize(s string) string
- func Snake(s string) string
- func WrapListener(l net.Listener, stype string, logger log15.Logger) net.Listener
- type Closeable
- type GeoIP
- type Prestartable
- type RConn
- type RListener
- type RedisConn
- type RedisResult
- type Service
- type Startable
- type StdinListener
- type TempFile
Constants ¶
This section is empty.
Variables ¶
View Source
var GeoIPService = fx.Provide(func(lc fx.Lifecycle, args *arguments.Args, logger log15.Logger) (GeoIP, error) { if !args.GeoIP.Enabled { return nil, nil } s, err := NewGeoIP(args.GeoIP.DatabasePath) if err != nil { return nil, err } if lc != nil && s != nil { Append(lc, s, logger) } return s, nil })
View Source
var GeoIPURL = "https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz"
View Source
var HTMLType = filetype.NewType("html", "text/html")
View Source
var IcalType = filetype.NewType("ics", "text/calendar")
View Source
var MarkdownType = filetype.NewType("md", "text/markdown")
View Source
var OdtType = filetype.NewType("odt", "application/vnd.oasis.opendocument.text")
View Source
var PlainType = filetype.NewType("txt", "text/plain")
View Source
var RedisService = fx.Provide(func(lc fx.Lifecycle, args *arguments.Args, logger log15.Logger) (RedisResult, error) { var collector, consumer RedisConn var err error if args.Collector.Type == "redis" { collector, err = NewRedisClient(args.Redis.URL) if err != nil { return RedisResult{}, err } } if args.Consumer.GetType() == arguments.Redis { consumer, err = NewRedisClient(args.Redis.URL) if err != nil { return RedisResult{}, err } } Append(lc, collector, logger) Append(lc, consumer, logger) return RedisResult{ Collector: collector, Consumer: consumer, }, nil })
View Source
var RestType = filetype.NewType("rst", "text/x-rst")
Functions ¶
func DownloadGeoIP ¶
func GuessReader ¶
func IsPrivateIP ¶
func JSONMarshal ¶
func JSONString ¶
func JSONString(v interface{}) string
func NewHTTPCacheClient ¶
func NewHTTPClient ¶
func NewStdinListener ¶
Types ¶
type Closeable ¶
type Closeable interface { // Close stops and cleans the long-running services. It should return only when all the service goroutines have stopped. Close() error }
type Prestartable ¶
type Prestartable interface { // Prestart perform some immediate initialization steps. Prestart() error }
type RedisConn ¶
type RedisConn interface { Service Prestartable Closeable Client() *redis.Client }
func NewRedisClient ¶
type RedisResult ¶
type StdinListener ¶
type StdinListener struct {
// contains filtered or unexported fields
}
func (*StdinListener) Addr ¶
func (l *StdinListener) Addr() net.Addr
func (*StdinListener) Close ¶
func (l *StdinListener) Close() error
type TempFile ¶
type TempFile struct {
// contains filtered or unexported fields
}
func NewTempFile ¶
Click to show internal directories.
Click to hide internal directories.