config

package
v0.0.0-...-7c4a8a6 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Env            Env      `default:"local" envconfig:"APP_ENV"`
	Port           int      `default:"8000" envconfig:"PORT"`
	AllowedOrigins []string `default:"http://localhost:3000,http://localhost:3333" envconfig:"ALLOWED_ORIGINS"`

	GCPProjectID       string `default:"local" envconfig:"GCP_PROJECT_ID"`
	PubSubEventTopicID string `envconfig:"PUBSUB_EVENT_TOPIC_ID"`

	SpannerInstanceID string `envconfig:"SPANNER_INSTANCE_ID"`
	SpannerDatabaseID string `envconfig:"SPANNER_DATABASE_ID"`

	VertexAICategoryClassificationEndpointID string `envconfig:"VERTEX_AI_CATEGORY_CLASSIFICATION_ENDPOINT_ID"`

	SanityProjectID string `envconfig:"SANITY_PROJECT_ID"`
	SanityDatasetID string `default:"development" envconfig:"SANITY_DATASET_ID"`

	ElasticSearchUsername string `envconfig:"ELASTICSEARCH_USERNAME"`
	ElasticSearchPassword string `envconfig:"ELASTICSEARCH_PASSWORD"`
	ElasticSearchURL      string `default:"http://localhost:9200" envconfig:"ELASTICSEARCH_URL"`
	// ItemsIndexName                 string `default:"items" envconfig:"ITEMS_INDEX_NAME"`
	ItemsIndexName                 string `default:"items" envconfig:"ITEMS_INDEX_NAME"`
	ItemsQuerySuggestionsIndexName string `default:"items.query_suggestions" envconfig:"ITEMS_QUERY_SUGGESTIONS_INDEX_NAME"`
}

func NewConfig

func NewConfig() (*Config, error)

type Env

type Env string
const (
	EnvLocal Env = "local"
	EnvTest  Env = "test"
	EnvDev   Env = "dev"
	EnvProd  Env = "prod"
)

func (Env) IsDeployed

func (e Env) IsDeployed() bool

Jump to

Keyboard shortcuts

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