platform

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOAuthSession

func CreateOAuthSession(ctx context.Context, p *CreateOAuthSessionParams) (authURL string, err error)

func DBConnect

func DBConnect(ctx context.Context, appSlug, envSlug, dbName string, startupData []byte) (*websocket.Conn, error)

func EnvLogs

func EnvLogs(ctx context.Context, appSlug, envSlug string) (*websocket.Conn, error)

func GetAppSecrets

func GetAppSecrets(ctx context.Context, appSlug string, poll bool, kind SecretKind) (secrets map[string]string, err error)

func GetEnvMeta

func GetEnvMeta(ctx context.Context, appSlug, envName string) (*metav1.Data, error)

Types

type App

type App struct {
	Slug        string  `json:"slug"`
	Name        string  `json:"name"`
	Description string  `json:"description"` // can be blank
	MainBranch  *string `json:"main_branch"` // nil if not set
}

func CreateApp

func CreateApp(ctx context.Context, p *CreateAppParams) (*App, error)

func GetApp

func GetApp(ctx context.Context, appSlug string) (*App, error)

func ListApps added in v1.3.0

func ListApps(ctx context.Context) ([]*App, error)

type CreateAppParams

type CreateAppParams struct {
	Name string `json:"name"`
}

type CreateOAuthSessionParams

type CreateOAuthSessionParams struct {
	Challenge   string `json:"challenge"`
	State       string `json:"state"`
	RedirectURL string `json:"redirect_url"`
}

type Env added in v1.3.0

type Env struct {
	Slug  string `json:"slug"`
	Type  string `json:"type"`
	Cloud string `json:"cloud"`
}

func ListEnvs added in v1.3.0

func ListEnvs(ctx context.Context, appSlug string) ([]*Env, error)

type Error

type Error struct {
	HTTPStatus string `json:"-"`
	HTTPCode   int    `json:"-"`
	Code       string
	Detail     json.RawMessage
}

func (Error) Error

func (e Error) Error() string

type ExchangeAuthKeyParams

type ExchangeAuthKeyParams struct {
	AuthKey string `json:"auth_key"`
}

type ExchangeOAuthTokenParams

type ExchangeOAuthTokenParams struct {
	Challenge string `json:"challenge"`
	Code      string `json:"code"`
}

type OAuthData

type OAuthData struct {
	Token   *oauth2.Token `json:"token"`
	Email   string        `json:"email"`    // empty if logging in as an app
	AppSlug string        `json:"app_slug"` // empty if logging in as a user
}

func ExchangeAuthKey

func ExchangeAuthKey(ctx context.Context, p *ExchangeAuthKeyParams) (*OAuthData, error)

func ExchangeOAuthToken

func ExchangeOAuthToken(ctx context.Context, p *ExchangeOAuthTokenParams) (*OAuthData, error)

type SecretKind

type SecretKind string
const (
	DevelopmentSecrets SecretKind = "development"
	ProductionSecrets  SecretKind = "production"
)

type SecretVersion

type SecretVersion struct {
	Number  int       `json:"number"`
	Created time.Time `json:"created"`
}

func SetAppSecret

func SetAppSecret(ctx context.Context, appSlug string, kind SecretKind, secretKey, value string) (*SecretVersion, error)

Jump to

Keyboard shortcuts

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