platform

package
v1.41.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MPL-2.0 Imports: 25 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 CreateSecretGroup added in v1.13.0

func CreateSecretGroup(ctx context.Context, p CreateSecretGroupParams) error

func CreateSecretVersion added in v1.13.0

func CreateSecretVersion(ctx context.Context, p CreateSecretVersionParams) 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 GetEnvMeta

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

func GetLocalSecretValues added in v1.13.0

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

func ListSecretGroups added in v1.13.0

func ListSecretGroups(ctx context.Context, appSlug string, keys []string) ([]*gql.Secret, error)

func UpdateSecretGroup added in v1.13.0

func UpdateSecretGroup(ctx context.Context, p UpdateSecretGroupParams) error

Types

type App

type App struct {
	ID          string  `json:"eid"`
	LegacyID    string  `json:"id"`
	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 BeginAuthorizationFlowParams added in v1.21.1

type BeginAuthorizationFlowParams struct {
	CodeChallenge string
	ClientID      string
}

type BeginAuthorizationFlowResponse added in v1.21.1

type BeginAuthorizationFlowResponse struct {
	// DeviceCode is the device verification code.
	DeviceCode string `json:"device_code"`

	// UserCode is the end-user verification code.
	UserCode string `json:"user_code"`

	// VerificationURI is the end-user URL to use to login.
	VerificationURI string `json:"verification_uri"`

	// ExpiresIn is the lifetime in seconds of the device code and user code.
	ExpiresIn int `json:"expires_in"`

	// Interval is the number of seconds to wait between polling requests.
	// If not provided, defaults to 5.
	Interval int `json:"interval,omitempty"`
}

func BeginDeviceAuthFlow added in v1.21.1

type CreateAppParams

type CreateAppParams struct {
	Name           string `json:"name"`
	InitialSecrets map[string]string
}

type CreateOAuthSessionParams

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

type CreateSecretGroupParams added in v1.13.0

type CreateSecretGroupParams struct {
	AppID          string
	Key            string
	PlaintextValue string
	Description    string
	Selector       []gql.SecretSelector
}

type CreateSecretVersionParams added in v1.13.0

type CreateSecretVersionParams struct {
	GroupID        string
	PlaintextValue string
	Etag           string
}

type Env added in v1.3.0

type Env struct {
	ID    string `json:"id"`
	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 InterfaceCodecExtension added in v1.13.0

type InterfaceCodecExtension struct {
	jsoniter.DummyExtension
}

InterfaceCodecExtension is used to decode interface fields it'll store the type of the values in a wrapper object

func NewInterfaceCodecExtension added in v1.13.0

func NewInterfaceCodecExtension() *InterfaceCodecExtension

func (*InterfaceCodecExtension) DecorateDecoder added in v1.13.0

func (e *InterfaceCodecExtension) DecorateDecoder(typ reflect2.Type, decoder jsoniter.ValDecoder) jsoniter.ValDecoder

type KubeCtlConfig added in v1.27.0

type KubeCtlConfig struct {
	EnvID            string `json:"env_id"`              // The ID of the environment
	ResID            string `json:"res_id"`              // The ID of the cluster
	Name             string `json:"name"`                // The name of the cluster
	DefaultNamespace string `json:"namespace,omitempty"` // The default namespace for the cluster (if any)
}

func KubernetesClusters added in v1.27.0

func KubernetesClusters(ctx context.Context, appSlug string, envName string) (string, string, []KubeCtlConfig, error)

type OAuthData

type OAuthData struct {
	Token   *oauth2.Token `json:"token"`
	Actor   string        `json:"actor,omitempty"` // The ID of the user or app that authorized the 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 OAuthToken added in v1.21.1

type OAuthToken struct {
	*oauth2.Token
	Actor   string `json:"actor,omitempty"` // The ID of the user or app that authorized the 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 PollDeviceAuthFlow added in v1.21.1

func PollDeviceAuthFlow(ctx context.Context, p PollDeviceAuthFlowParams) (*OAuthToken, error)

type PollDeviceAuthFlowParams added in v1.21.1

type PollDeviceAuthFlowParams struct {
	DeviceCode   string
	CodeVerifier string
}

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)

type UpdateSecretGroupParams added in v1.13.0

type UpdateSecretGroupParams struct {
	ID   string
	Etag *string

	// Nil fore ach field here means it's kept unchanged.
	Selector    []gql.SecretSelector // nil means no changes
	Archived    *bool
	Description *string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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