cmd

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TELAR_GITHUB_USER_NAME = "red-gold"
	IMAGE_OWNER            = "telar"
	REGISTRY_URL           = "docker.io/telar/"

	// Client Actions
	SET_SETUP_STATE          = "SET_SETUP_STATE"
	SET_SETUP_STEP           = "SET_SETUP_STEP"
	SET_INPUT                = "SET_INPUT"
	SET_DEPLOY_OPEN          = "SET_DEPLOY_OPEN"
	SET_SETUP_DEFAULT_VALUES = "SET_SETUP_DEFAULT_VALUES"
	POP_MESSAGE              = "POP_MESSAGE"
	SET_STEP_CONDITION       = "SET_STEP_CONDITION"
	SHOW_INFO_DIALOG         = "SHOW_INFO_DIALOG"

	// Server HTTP Actions
	START_STEP                 = "START_STEP"
	REMOVE_SOCIAL_FROM_CLUSTER = "REMOVE_SOCIAL_FROM_CLUSTER"
	ECHO_PROJECT_DIR           = "ECHO_PROJECT_DIR"
	CHECK_STEP                 = "CHECK_STEP"
)
View Source
const (
	Source = "garbage-collect"

	FunctionLabelPrefix = "telar.dev."
)
View Source
const (
	// NoTLSWarn Warning thrown when no SSL/TLS is used
	NoTLSWarn = "WARNING! You are not using an encrypted connection to the gateway, consider using HTTPS."
)
View Source
const SETUP_YAML_FILE_NAME = "setup.yml"

Variables

This section is empty.

Functions

func CheckDatabase

func CheckDatabase(mongoDBURI string)

func CheckIngredient

func CheckIngredient(projectPath string, githubUsername string)

func CheckInitStep

func CheckInitStep(input *ClientInputs)

func CheckOAuth

func CheckOAuth()

func CheckRecaptcha

func CheckRecaptcha()

func CheckStorage

func CheckStorage(projectPath string, bucketName string)

func CheckUserManagement

func CheckUserManagement(ofGateway string)

func CheckWebsocket

func CheckWebsocket(clientInput ClientInputs)

func ClientHandler

func ClientHandler(w http.ResponseWriter, r *http.Request)

func Echo

func Echo(message ClientAction)

func GetGatewayURL added in v0.2.1

func GetGatewayURL(argumentURL, defaultURL, yamlURL, environmentURL string) string

func GetOFProxyClient added in v0.2.1

func GetOFProxyClient(gateway, token string, tlsInsecure bool) (*proxy.Client, error)

func OFCAccessSetting added in v0.2.1

func OFCAccessSetting()

func OpenURLHandler

func OpenURLHandler(w http.ResponseWriter, r *http.Request)

func PingHandler added in v0.1.1

func PingHandler(w http.ResponseWriter, r *http.Request)

func Pipeline added in v0.2.1

func Pipeline(cmds ...*exec.Cmd) (pipeLineOutput, collectedStandardError []byte, pipeLineError error)

To provide input to the pipeline, assign an io.Reader to the first's Stdin.

func RemoveOFFunctions added in v0.2.1

func RemoveOFFunctions(garbageReq GarbageRequest) (string, error)

Handle function cleans up functions which were removed or renamed within the repo for the given user.

func StartStep

func StartStep()

func WsHandler

func WsHandler(w http.ResponseWriter, r *http.Request)

Types

type ClientAction

type ClientAction struct {
	Type    string      `json:"type"`
	Payload interface{} `json:"payload"`
}

type ClientInputs

type ClientInputs struct {
	BaseAPIRoute        string `json:"baseAPIRoute"  yaml:"baseAPIRoute,omitempty"`
	BaseHref            string `json:"baseHref"  yaml:"baseHref,omitempty"`
	AppName             string `json:"appName"  yaml:"appName,omitempty"`
	CompanyName         string `json:"companyName"  yaml:"companyName,omitempty"`
	SupportEmail        string `json:"supportEmail"  yaml:"supportEmail,omitempty"`
	AppID               string `json:"appID"  yaml:"appID,omitempty"`
	OFUsername          string `json:"ofUsername"  yaml:"ofUsername,omitempty"`
	OFGateway           string `json:"ofGateway"  yaml:"ofGateway,omitempty"`
	SocialDomain        string `json:"socialDomain"  yaml:"socialDomain,omitempty"`
	SecretName          string `json:"secretName"  yaml:"secretName,omitempty"`
	Namespace           string `json:"namespace"  yaml:"namespace,omitempty"`
	DockerUser          string `json:"dockerUser"  yaml:"dockerUser,omitempty"`
	KubeconfigPath      string `json:"kubeconfigPath"  yaml:"kubeconfigPath,omitempty"`
	ProjectDirectory    string `json:"projectDirectory"  yaml:"projectDirectory,omitempty"`
	BucketName          string `json:"bucketName"  yaml:"bucketName,omitempty"`
	MongoDBURI          string `json:"mongoDBURI"  yaml:"mongoDBURI,omitempty"`
	MongoDBName         string `json:"mongoDBName"  yaml:"mongoDBName,omitempty"`
	SiteKeyRecaptcha    string `json:"siteKeyRecaptcha"  yaml:"siteKeyRecaptcha,omitempty"`
	RecaptchaKey        string `json:"recaptchaKey"  yaml:"recaptchaKey,omitempty"`
	GithubOAuthSecret   string `json:"githubOAuthSecret"  yaml:"githubOAuthSecret,omitempty"`
	GithubOAuthClientID string `json:"githubOAuthClientID"  yaml:"githubOAuthClientID,omitempty"`
	AdminUsername       string `json:"adminUsername"  yaml:"adminUsername,omitempty"`
	AdminPassword       string `json:"adminPassword"  yaml:"adminPassword,omitempty"`
	Gmail               string `json:"gmail"  yaml:"gmail,omitempty"`
	GmailPassword       string `json:"gmailPassword"  yaml:"gmailPassword,omitempty"`
	Gateway             string `json:"gateway"  yaml:"gateway,omitempty"`
	PayloadSecret       string `json:"payloadSecret"  yaml:"payloadSecret,omitempty"`
	WebsocketURL        string `json:"websocketURL"  yaml:"websocketURL,omitempty"`
}

type ClientState

type ClientState struct {
	SetupState string       `json:"setupState"`
	SetupStep  int          `json:"setupStep"`
	Inputs     ClientInputs `json:"inputs"`
}

type DialogInfoPayload

type DialogInfoPayload struct {
	Message string `json:"message"`
	URL     string `json:"url"`
}

type GarbageRequest added in v0.2.1

type GarbageRequest struct {
	Functions   []string `json:"functions"`
	Repo        string   `json:"repo"`
	Namespace   string   `json:"namespace"`
	AppID       string   `json:"appID"`
	Token       string   `json:"token"`
	Gateway     string   `json:"gateway"`
	TLSInsecure bool     `json:"tlsInsecure"`
}

type OFCSetupCache added in v0.2.1

type OFCSetupCache struct {
	ClientInputs ClientInputs `json:"clientInputs" yaml:"clientInputs,omitempty"`
}

type OpenURLModel

type OpenURLModel struct {
	URL string `json:"url"`
}

type RemoveFnPayload added in v0.2.1

type RemoveFnPayload struct {
	ProjectDirectory string `json:"projectDirectory"`
}

type ServerAction

type ServerAction struct {
	Type    string      `json:"type"`
	Payload interface{} `json:"payload"`
}

type TelarConfig

type TelarConfig struct {
	AppID            string `json:"ppID"`
	SecretName       string `json:"secretName"`
	GithubUsername   string `json:"githubUsername"`
	PathWD           string `json:"pathWD"`
	CoockieDomain    string `json:"coockieDomain"`
	Bucket           string `json:"bucket"`
	ClientID         string `json:"clientID"`
	Gateway          string `json:"gateway"`
	Origin           string `json:"origin"`
	WebsocketURL     string `json:"websocketURL"`
	MongoDBURI       string `json:"mongoDBURI"`
	MongoDatabase    string `json:"mongoDatabase"`
	RecaptchaSiteKey string `json:"recaptchaSiteKey"`
	RefEmail         string `json:"refEmail"`
}

type TelarSecrets

type TelarSecrets struct {
	MongoURI,
	MongoDB,
	RecaptchaKey,
	TsClientSecret,
	RedisPwd,
	AdminUsername,
	AdminPwd,
	PayloadSecret,
	RefEmailPwd,
	PhoneAuthToken,
	PhoneAuthId string
}

type UIGatewayConfig

type UIGatewayConfig struct {
	Websocket UIWebsocketConfig `json:"websocket"`
}

type UIWebsocketConfig

type UIWebsocketConfig struct {
	URL string `json:"url"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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