27 lines
451 B
Go
27 lines
451 B
Go
package gorrent
|
|
|
|
import "context"
|
|
|
|
var version = `1.0.0`
|
|
|
|
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
|
|
}
|