config

package
v0.0.0-...-f94728f Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "mtc2018"

ServiceName pass to other service.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Tags        []string     `json:"tags"`
	Sessions    []Session    `json:"sessions"`
	News        []News       `json:"news"`
	Exhibitions []Exhibition `json:"exhibitions"`
	Slides      []Slide      `json:"slides"`
	Movies      []Movie      `json:"movies"`
}

Data provides content of contents.json.

func Load

func Load() (*Data, error)

Load from contents.json assets

type Env

type Env struct {
	// LogLevel is INFO or DEBUG. Default is "INFO".
	LogLevel string `envconfig:"LOG_LEVEL" default:"INFO"`

	// Env is environment where application is running. This value is used to
	// annotate datadog metrics or sentry error reporting. The value must be
	// "development" or "production".
	Env string `envconfig:"ENV" required:"true"`

	// DDAgentHostname is hostname where datadog agent working.
	DDAgentHostname string `envconfig:"DD_AGENT_HOSTNAME" default:"localhost"`

	// Port is port to listen.
	Port int `envconfig:"HTTP_PORT" default:"8080"`

	// UseSpanner enables spanner to persistent for like model
	UseSpanner        bool   `envconfig:"USE_SPANNER" default:"false"`
	SpannerProjectID  string `envconfig:"SPANNER_PROJECT_ID" default:""`
	SpannerInstanceID string `envconfig:"SPANNER_INSTANCE_ID" default:""`
	SpannerDatabaseID string `envconfig:"SPANNER_DATABASE_ID" default:""`
}

Env stores configuration settings extract from environmental variables by using https://github.com/kelseyhightower/envconfig

The practice getting from environmental variables comes from https://12factor.net.

func ReadFromEnv

func ReadFromEnv() (*Env, error)

ReadFromEnv reads configuration from environmental variables defined by Env struct.

type Exhibition

type Exhibition struct {
	ExhibitionID  int    `json:"id"` // Relay Global Object ID SpecのIDではない
	Place         string `json:"place"`
	Title         string `json:"title"`
	TitleJa       string `json:"titleJa"`
	Description   string `json:"description"`
	DescriptionJa string `json:"descriptionJa"`
}

Exhibition information.

type Movie

type Movie struct {
	URL       string `json:"url"`
	SessionID int    `json:"sessionId"`
	SpeakerID string `json:"speakerId"`
}

Movie information

type News

type News struct {
	NewsID    string `json:"id"` // Relay Global Object ID SpecのIDではない
	Date      string `json:"date"`
	Message   string `json:"message"`
	MessageJa string `json:"messageJa"`
	Link      string `json:"link"`
}

News information

type Session

type Session struct {
	SessionID int       `json:"id"` // Relay Global Object ID SpecのIDではない
	Type      string    `json:"type"`
	Place     string    `json:"place"`
	Title     string    `json:"title"`
	TitleJa   string    `json:"titleJa"`
	StartTime string    `json:"startTime"`
	EndTime   string    `json:"endTime"`
	Outline   string    `json:"outline"`
	OutlineJa string    `json:"outlineJa"`
	Lang      string    `json:"lang"`
	Tags      []string  `json:"tags"`
	Speakers  []Speaker `json:"speakers"`
}

Session information.

type Slide

type Slide struct {
	Lang      string `json:"lang"`
	URL       string `json:"url"`
	SessionID int    `json:"sessionId"`
	SpeakerID string `json:"speakerId"`
}

Slide information

type Speaker

type Speaker struct {
	SpeakerID  string `json:"id"` // Relay Global Object ID SpecのIDではない
	Name       string `json:"name"`
	NameJa     string `json:"nameJa"`
	Company    string `json:"company"`
	Position   string `json:"position"`
	PositionJa string `json:"positionJa"`
	Profile    string `json:"profile"`
	ProfileJa  string `json:"profileJa"`
	IconURL    string `json:"iconUrl"`
	TwitterID  string `json:"twitterId"`
	GithubID   string `json:"githubId"`
}

Speaker information.

Directories

Path Synopsis
Package statik contains static assets.
Package statik contains static assets.

Jump to

Keyboard shortcuts

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