config

package
v0.1.31-0...-b1e5c7a Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2018 License: ISC Imports: 2 Imported by: 0

Documentation

Overview

Package config provides a way to configure gonawin app. It reads a config.json file similar to github.com/taironas/gonawin/example-config.json

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Facebook

type Facebook struct {
	AppId string `json:"appId"`
}

Facebook holds data needed for Facebook authentication.

type GooglePlus

type GooglePlus struct {
	ClientId string `json:"clientId"`
}

GooglePlus holds data needed for GooglePlus authentication.

type GwConfig

type GwConfig struct {
	APIVersion  string     `json:"apiVersion"`
	OfflineMode bool       `json:"offlineMode"`
	OfflineUser User       `json:"offlineUser"`
	DevUsers    []User     `json:"devUsers"`
	Twitter     Twitter    `json:"twitter"`
	Facebook    Facebook   `json:"facebook"`
	GooglePlus  GooglePlus `json:"googlePlus"`
}

GwConfig is configuration structure to hold the JSON unmarshalled data.

func ReadConfig

func ReadConfig(filename string) (*GwConfig, error)

ReadConfig reads configuration file and return it.

type Twitter

type Twitter struct {
	Token  string `json:"token"`
	Secret string `json:"secret"`
}

Twitter holds data needed for Twitter authentication.

type User

type User struct {
	Email    string `json:"email"`
	Username string `json:"username"`
	Name     string `json:"name"`
}

User is the user structure used for authentication.

Jump to

Keyboard shortcuts

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