gorrent/gorrent.go

29 lines
502 B
Go
Raw Permalink Normal View History

2022-03-20 00:11:19 +03:00
package gorrent
import "context"
2022-03-20 00:11:19 +03:00
var version = `1.0.0`
const defaultMaxReadaheadBytes = 20 * 1024 * 1024
2022-03-20 00:11:19 +03:00
func GetMetaFromFile(path string) (*Info, error) {
info := &Info{}
if err := info.LoadFile(path); err != nil {
return info, err
}
return info, nil
}
func Version() string {
return version
}
func NewEngine(settings *Settings) *Engine {
e := &Engine{
settings: settings,
msgs: make(chan string, 50),
}
e.ctx, e.shutdown = context.WithCancel(context.Background())
return e
}