Documentation ¶
Overview ¶
Interactions with the OpenSubtitles API
Some useful functions
Index ¶
- Constants
- func CheckFilePath(path string) bool
- func GetFilesFromSubfolder(subfolder string, extension string, recursive bool) ([]string, error)
- func GetSlugFromString(filename string) string
- func Hash(password, salt string) string
- func InArray(a []string, e string) bool
- func InitFromConfiguration()
- func Login() error
- func Logout() error
- func OpenSubtitlesClose()
- func OpensubtitlesHash(filename string) (string, uint64, error)
- func SaltGenerator() string
- func SearchSubtitles(hash string, size uint64, imdbId string, lang string) ([]string, error)
- func TryToUtf8(s string, lang string) string
- func UuidGenerator() (string, error)
- func WriteJsonResult(ret map[string]interface{}, w http.ResponseWriter, code int)
- func WriteResponse(content interface{}, w http.ResponseWriter, contentType string, code int)
Constants ¶
View Source
const LANG_EN = "eng"
View Source
const LANG_FR = "fre"
Variables ¶
This section is empty.
Functions ¶
func GetFilesFromSubfolder ¶
Get all files with the given extension in the given directory
func GetSlugFromString ¶
Get a slug from the given filename
func InitFromConfiguration ¶
func InitFromConfiguration()
func OpensubtitlesHash ¶
Compute the hash of a file, and returns it plus its size Adapted from https://github.com/oz/osdb
func SearchSubtitles ¶
Search subtitles
func UuidGenerator ¶
UUID generating function From: http://play.golang.org/p/4FkNSiUDMg
func WriteJsonResult ¶
func WriteJsonResult(ret map[string]interface{}, w http.ResponseWriter, code int)
Answer the user's query with the given codes and with a json object constructed from 'ret'.
func WriteResponse ¶
func WriteResponse(content interface{}, w http.ResponseWriter, contentType string, code int)
Set http error code and content-type and write response
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.