helpers

package
v0.0.0-...-f3dad25 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateShikimoriByToken

func CreateShikimoriByToken(conf *oauth2.Config, tok *oauth2.Token, appName, version string) *goshikimori.Shikimori

CreateShikimoriByToken returns Shikimori based on http.DefaultClient

func GetAppName

func GetAppName() string

GetAppName returns Shikimori application name

func GetConfig

func GetConfig() (*oauth2.Config, error)

GetConfig returns oauth2 config from file. If cannot, tries create from env-vars

func GetShikimori

func GetShikimori(version string) (*goshikimori.Shikimori, error)

GetShikimori returns goshikimori.Shikimori by config and token from files (using loadOAuth). If loadOAuth returns error, try create config/token from env-vars

func GetToken

func GetToken(conf *oauth2.Config) (*oauth2.Token, error)

GetToken returns oauth2 token from file. If cannot, try get from env-variables

func SaveToken

func SaveToken(shiki *goshikimori.Shikimori)

SaveToken to file (if token changed)

Types

This section is empty.

Jump to

Keyboard shortcuts

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