config

package
v0.0.0-...-c7b2723 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FacebookOAuth = "facebook"
	TwitterOAuth  = "twitter"
	GithubOAuth   = "github"
	GoogleOAuth   = "google"
)

nolint

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	URL   string `yaml:"url"`
	Token string `yaml:"token"`
}

API APIの情報

type APIConfigs

type APIConfigs map[string]*API

APIConfigs は用途ごとのAPI情報を持つ

func NewAPIConfigs

func NewAPIConfigs(r io.Reader) (APIConfigs, error)

NewAPIConfigs io.ReaderからAPI設定を読み取る

func NewAPIConfigsFromFile

func NewAPIConfigsFromFile(path string) (APIConfigs, error)

NewAPIConfigsFromFile Configから設定を読み取る

func (APIConfigs) Get

func (sc APIConfigs) Get(purpose string) (*API, error)

Get 指定されたAPI情報を返す

type APIs

type APIs struct {
	Connpass   API
	Doorkeeper API
	ATND       API
}

APIs API情報をまとめる構造体

func NewAPIsConf

func NewAPIsConf(conf APIConfigs) (*APIs, error)

NewAPIsConf APIの設定をまとめて構造体に入れて返す

type LittleTags

type LittleTags struct {
	Name  string `yaml:"name"`
	Regex string `yaml:"regex"`
}

LittleTags 小タグ情報

type MajorTags

type MajorTags struct {
	MajorTags  string       `yaml:"majorTags"`
	LittleTags []LittleTags `yaml:"littleTags"`
}

MajorTags 大タグ情報

type Oauth

type Oauth struct {
	ClientID     string `yaml:"client_id"`
	ClientSecret string `yaml:"client_secret"`
	RedirectURL  string `yaml:"redirect_url"`
	Endpoint     struct {
		AuthURL  string `yaml:"auth_url"`
		TokenURL string `yaml:"token_url"`
	} `yaml:"endpoint"`
}

Oauth Oauth認証情報

type Oauths

type Oauths map[string]*Oauth

Oauths はサービスごとのOauth認証情報を持つ

func NewOauths

func NewOauths(r io.Reader) (Oauths, error)

NewOauths io.ReaderからOauth設定を読み取る

func NewOauthsFromFile

func NewOauthsFromFile(path string) (Oauths, error)

NewOauthsFromFile Configから設定を読み取る

func (Oauths) Get

func (oc Oauths) Get(service string) (*oauth2.Config, error)

Get は指定されたサービスのOauth認証情報を返す

type Tags

type Tags struct {
	MajorTags []MajorTags `tags`
}

Tags タグ情報

func NewTag

func NewTag(r io.Reader) (*Tags, error)

NewTag io.Readerから設定を読み取る

func NewTagFromFile

func NewTagFromFile(path string) (*Tags, error)

NewTagFromFile 設定を読み取る

Jump to

Keyboard shortcuts

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