models

package module
v0.0.0-...-97f21a3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: MIT Imports: 0 Imported by: 8

README

Anigo models

Anigo models to make your plugins.




Usage

Dependencies

  • Go 1.19

How do i create my plugin?

# Create a gomodule
go mod init <name>
# Install dependencies.
go get github.com/FlamesX-128/anigo-plugins/models
// Create the plugin.
// Currently only plugins from providers like gogoanime.
package main

import "github.com/FlamesX-128/anigo-plugins/models"

type PackageModel struct{}

// Here you must return the list of animes that were found based on certain keywords.
type (p PackageModel) Search(query string) []models.Anime {}

// here you must return the information of a specific anime.
type (p PackageModel) Info(id string) models.Info {}

// here you must return the urls to be able to see it.
type (p PackageModel) Watch(query string) []models.Source {}

// Create the plugin symbol.
var Plugin = models.Plugin{
	Providers: map[string]models.Provider{
		"myplugin": PackageModel{},
	},
}
# Build you plugin.
go build -buildmode=plugin -o "myplugin@1.0.0.so" main.go

Plugin directory

Anigo will look for the anigo-plugins folder in the current directory from where it is called.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Resources

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Anime

type Anime struct {
	Title string
	Id    string
}

type Episode

type Episode struct {
	Number uint32
	Id     string
}

type Info

type Info struct {
	Episodes []Episode
	Image    string
}

type Plugin

type Plugin struct {
	Providers map[string]Provider
}

type Provider

type Provider interface {
	Search(string) []Anime
	Info(string) Info
	Watch(string) []Source
}

type Source

type Source struct {
	Quality string
	Url     string
}

Jump to

Keyboard shortcuts

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