Documentation ¶
Index ¶
- Constants
- Variables
- func EnsureProjectNameFileExists() error
- func Env() ([]string, error)
- func GetDockerComposeProjectName() (string, error)
- func Init()
- func InitLocations() error
- func NewTemplatesInstaller(logger logrus.FieldLogger) *templatesInstaller
- func ParseEnvVarsFromConfig(payload map[interface{}]interface{}, prefix string) []string
- func RunCmdAndCaptureStderrIfNotSetup(cmd *exec.Cmd) error
- func UpdateLocations(old, new string)
- type App
- type Asset
- type Authentication
- type Configuration
- type Credentials
- type Domains
- type EnvVar
- type Error
- type Information
- type Project
- type Region
- type Release
- type Required
- type Response
- type Server
- type Service
- type Session
- type Team
- type TeamData
- type Template
- type User
- type Workspace
- type WorkspaceMember
Constants ¶
const ( DB_USER = "postgres" DB_PASSWORD = "postgres" MINIO_USER = "minioaccesskey123123" MINIO_PASSWORD = "minioaccesskey123123" )
Variables ¶
var ( DOMAIN string API string // fetch current working directory NHOST_DIR string // find user's home directory HOME string // Nhost root directory for HOME ROOT string // authentication file location AUTH_PATH string // path for migrations MIGRATIONS_DIR string // path for metadata METADATA_DIR string // default Nhost database DATABASE string // path for seeds SEEDS_DIR string // path for .nhost DOT_NHOST_DIR string // path for frontend WEB_DIR string // path for API code API_DIR string // path for email templates EMAILS_DIR string // path for local git directory GIT_DIR string // path for .env.development ENV_FILE string // path for config.yaml file CONFIG_PATH string // path for .gitignore file GITIGNORE string // path for .nhost/nhost.yaml file INFO_PATH string // path for express NPM modules NODE_MODULES_PATH string // package repository to download latest release from REPOSITORY string // mandatorily required locations LOCATIONS Required )
Functions ¶
func EnsureProjectNameFileExists ¶ added in v0.7.2
func EnsureProjectNameFileExists() error
func GetDockerComposeProjectName ¶ added in v0.7.1
func InitLocations ¶ added in v0.5.9
func InitLocations() error
func NewTemplatesInstaller ¶ added in v0.7.1
func NewTemplatesInstaller(logger logrus.FieldLogger) *templatesInstaller
func ParseEnvVarsFromConfig ¶
func RunCmdAndCaptureStderrIfNotSetup ¶ added in v0.7.1
func UpdateLocations ¶ added in v0.5.9
func UpdateLocations(old, new string)
Updates the directory paths in all variables TODO: refactor
Types ¶
type App ¶
type App struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Subdomain string `json:"subdomain,omitempty"` Region Region `json:"region"` AppSecrets model.Secrets `json:"appSecrets,omitempty"` Config *model.ConfigConfig `json:"config"` Workspace string `json:"workspace,omitempty"` }
type Asset ¶
type Asset struct { URL string `json:",omitempty"` Name string `json:",omitempty"` ID string `json:",omitempty"` Label string `json:",omitempty"` BrowserDownloadURL string `json:"browser_download_url,omitempty"` Size int `json:",omitempty"` }
GitHub Release API Assets structure
type Authentication ¶
type Authentication struct { Endpoints map[string]interface{} `yaml:",omitempty"` Providers map[string]interface{} `yaml:",omitempty"` Signin map[string]interface{} `yaml:",omitempty"` Signup map[string]interface{} `yaml:",omitempty"` Email map[string]interface{} `yaml:",omitempty"` Tokens map[string]interface{} `yaml:",omitempty"` Gravatar map[string]interface{} `yaml:",omitempty"` }
Nhost config.yaml authentication structure
type Configuration ¶
type Configuration struct { MetadataDirectory string `yaml:"metadata_directory,omitempty"` Services map[string]*Service `yaml:",omitempty"` Auth map[interface{}]interface{} `yaml:",omitempty"` Storage map[interface{}]interface{} `yaml:",omitempty"` Version int `yaml:",omitempty"` Sessions map[string]Session `yaml:",omitempty"` }
Nhost config.yaml root structure
func GenerateConfig ¶
func GenerateConfig(options App) Configuration
generates fresh config.yaml for /nhost dir
func GetConfiguration ¶ added in v0.7.1
func GetConfiguration() (*Configuration, error)
func (*Configuration) MarshalJSON ¶
func (r *Configuration) MarshalJSON() ([]byte, error)
func (*Configuration) MarshalYAML ¶
func (r *Configuration) MarshalYAML() ([]byte, error)
func (*Configuration) Save ¶
func (config *Configuration) Save() error
type Credentials ¶
Authentication credentials structure
func LoadCredentials ¶
func LoadCredentials() (Credentials, error)
fetches saved credentials from auth file
type Domains ¶
type Domains struct {
Hasura string `json:"hasura_domain,omitempty"`
}
Nhost project domains
type Information ¶
type Information struct { ProjectID string `yaml:"project_id,omitempty"` ID string `yaml:",omitempty"` Name string `yaml:",omitempty"` }
.nhost/nhost.yaml information
type Project ¶
type Project struct { ID string `json:"id" yaml:"project_id"` UserID string `json:"user_id"` Team Team `json:",omitempty"` TeamID string `json:"team_id,omitempty"` Type string `json:",omitempty"` Name string `json:"name"` HasuraGQEVersion string `json:"hasura_gqe_version,omitempty"` BackendVersion string `json:"backend_version,omitempty"` HasuraGQEAdminSecret string `json:"hasura_gqe_admin_secret,omitempty"` PostgresVersion string `json:"postgres_version,omitempty"` HasuraGQECustomEnvVariables map[string]string `json:"hasura_gqe_custom_env_variables,omitempty"` BackendUserFields string `json:"backend_user_fields,omitempty"` HBPDefaultAllowedUserRoles string `json:"hbp_DEFAULT_ALLOWED_USER_ROLES,omitempty"` HBPRegistrationCustomFields string `json:"hbp_REGISTRATION_CUSTOM_FIELDS,omitempty"` HBPAllowedUserRoles string `json:"hbp_allowed_user_roles,omitempty"` ProjectDomains Domains `json:"project_domain"` ProjectEnvVars []map[string]interface{} `json:"project_env_vars,omitempty"` }
Nhost project structure
func (*Project) MarshalJSON ¶
func (*Project) MarshalYAML ¶
type Release ¶
type Release struct { URL string `json:",omitempty"` Name string `json:",omitempty"` TagName string `json:"tag_name,omitempty"` Prerelease bool `json:",omitempty"` CreatedAt string `json:"created_at,omitempty"` PublishedAt string `json:",omitempty"` Body string `json:",omitempty"` Assets []Asset `json:",omitempty"` }
GitHub Release API reponse structure
func GetReleases ¶ added in v0.5.7
Downloads the list of all releases from GitHub API
func SearchRelease ¶ added in v0.5.7
Seaches for required release from supplied list of releases, and returns it.
func (*Release) Asset ¶
fetches the required asset from release depending on OS and Architecture by matching download URL
func (*Release) MarshalJSON ¶ added in v0.5.7
type Response ¶
type Response struct { Project Project `json:",omitempty"` User User Error Error Email string `json:"email"` VerificationToken string `json:"verificationToken"` VerifiedToken string `json:"token"` }
Authentication validation response
type Service ¶
type Service struct { Port int `yaml:",omitempty"` Version interface{} `yaml:",omitempty"` Image string `yaml:",omitempty"` // AdminSecret interface{} `yaml:"admin_secret,omitempty"` Name string `yaml:",omitempty"` Address string `yaml:",omitempty"` ID string `yaml:",omitempty"` Config *container.Config `yaml:",omitempty"` HostConfig *container.HostConfig `yaml:",omitempty"` HealthEndpoint string `yaml:"health_endpoint,omitempty"` Environment map[string]interface{} `yaml:",omitempty"` // If custom address is mentioned, // do not launch the container NoContainer bool `yaml:",omitempty"` // Channels are best thought of as queues (FIFO). // Therefore you can't really skip around. // We need a mutex to lock the service // before updating it's channels. sync.Mutex `yaml:",omitempty"` Active bool `yaml:",omitempty"` }
Nhost config.yaml service structure
type TeamData ¶
type TeamData struct {
Team Team `json:",omitempty"`
}
Nhost individual team structure
type User ¶
type User struct { ID string `json:"id,omitempty"` Name string `json:"displayName,omitempty"` WorkspaceMembers []WorkspaceMember `json:"workspaceMembers,omitempty"` }
Nhost user structure