api

package
v0.9.11 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderGCPDeprecated = "google"
	ProviderGCP           = "gcp"
	ProviderAWS           = "aws"
	ProviderAzure         = "azure"
	ProviderEquinix       = "equinix"
	ProviderKind          = "kind"
	TEST                  = "test"
)
View Source
const ArtifactFragment = `
	fragment ArtifactFragment on Artifact {
		id
		name
		readme
		platform
		arch
		blob
		sha
		filesize
	}
`
View Source
const CrdFragment = `
	fragment CrdFragment on Crd {
		id
		name
		blob
	}
`
View Source
const DependenciesFragment = `` /* 212-byte string literal not displayed */

Variables

View Source
var TerraformFragment = fmt.Sprintf(`
	fragment TerraformFragment on Terraform {
		id
		name
		package
		description
		dependencies { ...DependenciesFragment }
		valuesTemplate
	}
	%s
`, DependenciesFragment)
View Source
var TerraformInstallationFragment = fmt.Sprintf(`
	fragment TerraformInstallationFragment on TerraformInstallation {
		id
		terraform { ...TerraformFragment }
		version { ...VersionFragment }
	}
	%s
	%s
`, TerraformFragment, VersionFragment)
View Source
var VersionFragment = fmt.Sprintf(`
	fragment VersionFragment on Version {
		id
		readme
		version
		valuesTemplate
		package
		crds { ...CrdFragment }
		dependencies { ...DependenciesFragment }
	}
	%s
`, CrdFragment)

Functions

func ClearPackageCache

func ClearPackageCache()

func ConstructGqlClientRepositoryInput

func ConstructGqlClientRepositoryInput(marshalled []byte) (*gqlclient.RepositoryAttributes, error)

func ConstructRecipe

func ConstructRecipe(marshalled []byte) (recipe gqlclient.RecipeAttributes, err error)

func ConstructStack

func ConstructStack(marshalled []byte) (stack gqlclient.StackAttributes, err error)

func ConstructUpgradeAttributes

func ConstructUpgradeAttributes(marshalled []byte) (gqlclient.UpgradeAttributes, error)

func FromSlicePtr

func FromSlicePtr[T any](s []*T) []T

func GetErrorResponse

func GetErrorResponse(err error, methodName string) error

func NormalizeProvider

func NormalizeProvider(p string) string

func ToGQLClientProvider

func ToGQLClientProvider(p string) string

Types

type ApplyLock

type ApplyLock struct {
	Id   string
	Lock string
}

type Artifact

type Artifact struct {
	Id       string
	Name     string
	Readme   string
	Blob     string
	Sha      string
	Platform string
	Arch     string
	Filesize int
}

type ArtifactAttributes

type ArtifactAttributes struct {
	Name     string
	Readme   string
	Type     string
	Platform string
	Blob     string
	Arch     string
}

func ConstructArtifactAttributes

func ConstructArtifactAttributes(marshalled []byte) (ArtifactAttributes, error)

type Binding

type Binding struct {
	UserId  string
	GroupId string
}

type Chart

type Chart struct {
	Id            string
	Name          string
	Description   string
	LatestVersion string
	Dependencies  *Dependencies
}

func FindChart

func FindChart(client Client, repo, name string) (*Chart, error)

type ChartEdge

type ChartEdge struct {
	Node *Chart
}

type ChartInstallation

type ChartInstallation struct {
	Id           string
	Chart        *Chart
	Version      *Version
	Installation *Installation
}

type ChartInstallationEdge

type ChartInstallationEdge struct {
	Node *ChartInstallation
}

type ChartName

type ChartName struct {
	Repo  string
	Chart string
}

type ChatMessage

type ChatMessage struct {
	Name    string
	Content string
	Role    string
}

type Client

type Client interface {
	ListArtifacts(repo string) ([]Artifact, error)
	CreateArtifact(repo string, attrs ArtifactAttributes) (Artifact, error)
	Me() (*Me, error)
	LoginMethod(email string) (*LoginMethod, error)
	PollLoginToken(token string) (string, error)
	DeviceLogin() (*DeviceLogin, error)
	Login(email string, pwd string) (string, error)
	ImpersonateServiceAccount(email string) (string, string, error)
	CreateAccessToken() (string, error)
	GrabAccessToken() (string, error)
	ListKeys(emails []string) ([]*PublicKey, error)
	CreateKey(name string, content string) error
	GetEabCredential(cluster string, provider string) (*EabCredential, error)
	DeleteEabCredential(cluster string, provider string) error
	CreateEvent(event *UserEventAttributes) error
	GetTfProviders() ([]string, error)
	GetTfProviderScaffold(name string, version string) (string, error)
	GetRepository(repo string) (*Repository, error)
	CreateRepository(name string, publisher string, input *gqlclient.RepositoryAttributes) error
	AcquireLock(repo string) (*ApplyLock, error)
	ReleaseLock(repo string, lock string) (*ApplyLock, error)
	UnlockRepository(name string) error
	ListRepositories(query string) ([]*Repository, error)
	Scaffolds(in *ScaffoldInputs) ([]*ScaffoldFile, error)
	UpdateVersion(spec *VersionSpec, tags []string) error
	GetCharts(repoId string) ([]*Chart, error)
	GetVersions(chartId string) ([]*Version, error)
	GetTerraformVersions(id string) ([]*Version, error)
	GetChartInstallations(repoId string) ([]*ChartInstallation, error)
	GetPackageInstallations(repoId string) (charts []*ChartInstallation, tfs []*TerraformInstallation, err error)
	CreateCrd(repo string, chart string, file string) error
	CreateDomain(name string) error
	CreateInstallation(id string) (string, error)
	GetInstallation(name string) (*Installation, error)
	GetInstallationById(id string) (*Installation, error)
	GetInstallations() ([]*Installation, error)
	DeleteInstallation(id string) error
	OIDCProvider(id string, attributes *OidcProviderAttributes) error
	ResetInstallations() (int, error)
	CreateRecipe(repoName string, attrs gqlclient.RecipeAttributes) (string, error)
	GetRecipe(repo string, name string) (*Recipe, error)
	GetRecipeByID(id string) (*Recipe, error)
	ListRecipes(repo string, provider string) ([]*Recipe, error)
	InstallRecipe(id string) error
	GetShell() (CloudShell, error)
	DeleteShell() error
	GetTerraform(repoId string) ([]*Terraform, error)
	GetTerraformInstallations(repoId string) ([]*TerraformInstallation, error)
	UploadTerraform(dir string, repoName string) (Terraform, error)
	GetStack(name, provider string) (*Stack, error)
	CreateStack(attributes gqlclient.StackAttributes) (string, error)
	ListStacks(featured bool) ([]*Stack, error)
	UninstallChart(id string) error
	UninstallTerraform(id string) error
	CreateKeyBackup(attrs KeyBackupAttributes) error
	GetKeyBackup(name string) (*KeyBackup, error)
	ListKeyBackups() ([]*KeyBackup, error)
	GetHelp(prompt string) (string, error)
	DestroyCluster(domain, name, provider string) error
	CreateDependency(source, dest string) error
	PromoteCluster() error
	Clusters() ([]*Cluster, error)
	Cluster(id string) (*Cluster, error)
	CreateUpgrade(queue, repository string, attrs gqlclient.UpgradeAttributes) error
	TransferOwnership(name, email string) error
	Release(name string, tags []string) error
	Chat(history []*ChatMessage) (*ChatMessage, error)
	InstallVersion(tp, repo, pkg, vsn string) error
	CreateTrust(issuer, trust string) error
	DeleteTrust(id string) error
	OidcToken(provider gqlclient.ExternalOidcProvider, token, email string) (string, error)
	MarkSynced(repo string) error
}

func FromConfig

func FromConfig(conf *config.Config) Client

func NewClient

func NewClient() Client

type CloudShell

type CloudShell struct {
	Id     string
	AesKey string `json:"aesKey"`
	GitUrl string `json:"gitUrl"`
}

type Cluster

type Cluster struct {
	Id          string
	Name        string
	Provider    string
	UpgradeInfo []*UpgradeInfo
	Source      string
	GitUrl      string
	Owner       *User
}

type Condition

type Condition struct {
	Field     string
	Operation string
	Value     string
}

type ConditionInput

type ConditionInput struct {
	Field     string
	Value     string
	Operation string
}

type ConfigurationItem

type ConfigurationItem struct {
	Name          string
	Default       string
	Documentation string
	Type          string
	Placeholder   string
	FunctionName  string `json:"functionName" yaml:"functionName"`
	Optional      bool
	Condition     *Condition
	Validation    *Validation
}

type ConfigurationItemInput

type ConfigurationItemInput struct {
	Name          string
	Default       string
	Type          string
	Documentation string
	Placeholder   string
	Longform      string
	Optional      bool
	FunctionName  string `yaml:"functionName,omitempty" json:"functionName,omitempty"`
	Condition     *ConditionInput
	Validation    *ValidationInput
}

type Crd

type Crd struct {
	Id   string
	Name string
	Blob string
}

type Dependencies

type Dependencies struct {
	Dependencies    []*Dependency
	Providers       []string
	Wirings         *Wirings
	Secrets         []string
	Application     bool
	Wait            bool
	ProviderWirings map[string]interface{}
	Outputs         map[string]interface{}
	ProviderVsn     string
	CliVsn          string
}

type Dependency

type Dependency struct {
	Type string
	Repo string
	Name string
}

type DependencyInput

type DependencyInput struct {
	Name string
	Repo string
}

type DeviceLogin

type DeviceLogin struct {
	LoginUrl    string
	DeviceToken string
}

type DnsDomain

type DnsDomain struct {
	Id   string
	Name string
}

type EabCredential

type EabCredential struct {
	Id       string
	KeyId    string
	HmacKey  string
	Cluster  string
	Provider string
}

type Group

type Group struct {
	Id   string
	Name string
}

type Installation

type Installation struct {
	Id           string
	Repository   *Repository
	User         *User
	OIDCProvider *OIDCProvider `json:"oidcProvider"`
	LicenseKey   string
	Context      map[string]interface{}
	AcmeKeyId    string
	AcmeSecret   string
}

type InstallationEdge

type InstallationEdge struct {
	Node *Installation
}

type IntegrationInput

type IntegrationInput struct {
	Name        string
	Description string
	Icon        string
	SourceURL   string `json:"sourceUrl,omitempty"`
	Spec        string
	Type        string `json:"type,omitempty"`
	Tags        []Tag  `json:"tags,omitempty" yaml:"tags"`
}

type KeyBackup

type KeyBackup struct {
	Name         string
	Digest       string
	Repositories []string
	Value        string
	InsertedAt   string
}

type KeyBackupAttributes

type KeyBackupAttributes struct {
	Name         string
	Repositories []string
	Key          string
}

type LockAttributes

type LockAttributes struct {
	Lock string
}

type LoginMethod

type LoginMethod struct {
	LoginMethod string
	Token       string
}

type Me

type Me struct {
	Id                 string
	Email              string
	Demoing            bool
	TrustRelationships []*gqlclient.OidcTrustRelationshipFragment
}

type OAuthConfiguration

type OAuthConfiguration struct {
	Issuer                string
	AuthorizationEndpoint string
	TokenEndpoint         string
	JwksUri               string
	UserinfoEndpoint      string
}

type OIDCProvider

type OIDCProvider struct {
	Id            string
	ClientId      string
	ClientSecret  string
	RedirectUris  []string
	Bindings      []*ProviderBinding
	Configuration *OAuthConfiguration
}

type OIDCSettings

type OIDCSettings struct {
	DomainKey  string   `yaml:"domainKey"`
	UriFormat  string   `yaml:"uriFormat"`
	UriFormats []string `yaml:"uriFormats"`
	AuthMethod string   `yaml:"authMethod"`
	Subdomain  bool     `yaml:"subdomain"`
}

type OauthSettings

type OauthSettings struct {
	UriFormat  string `yaml:"uriFormat"`
	AuthMethod string `yaml:"authMethod"`
}

type OidcProviderAttributes

type OidcProviderAttributes struct {
	RedirectUris []string
	AuthMethod   string
	Bindings     []Binding
}

type PageInfo

type PageInfo struct {
	HasNextPage bool
	EndCursor   string
}

type ProviderBinding

type ProviderBinding struct {
	User  *User
	Group *Group
}

type PublicKey

type PublicKey struct {
	Id      string
	Content string
	User    *User
}

type PublicKeyEdge

type PublicKeyEdge struct {
	Node *PublicKey
}

type Publisher

type Publisher struct {
	Id   string
	Name string
}

type Recipe

type Recipe struct {
	Id                 string
	Name               string
	Provider           string
	Description        string
	Primary            bool
	Restricted         bool
	Tests              []*RecipeTest
	Repository         *Repository
	RecipeSections     []*RecipeSection
	OidcSettings       *OIDCSettings `yaml:"oidcSettings" json:"oidcSettings"`
	RecipeDependencies []*Recipe     `yaml:"recipeDependencies" json:"recipeDependencies"`
}

type RecipeEdge

type RecipeEdge struct {
	Node *Recipe
}

type RecipeInput

type RecipeInput struct {
	Name         string
	Description  string
	Provider     string
	Restricted   bool
	Primary      bool
	Tests        []RecipeTestInput `yaml:"tests" json:"tests,omitempty"`
	Sections     []RecipeSectionInput
	Dependencies []DependencyInput
	OidcSettings *OIDCSettings `yaml:"oidcSettings,omitempty"`
}

type RecipeItem

type RecipeItem struct {
	Id            string
	Terraform     *Terraform
	Chart         *Chart
	Configuration []*ConfigurationItem
}

type RecipeItemInput

type RecipeItemInput struct {
	Name string
	Type string
}

type RecipeSection

type RecipeSection struct {
	Id            string
	Repository    *Repository
	RecipeItems   []*RecipeItem
	Configuration []*ConfigurationItem
}

type RecipeSectionInput

type RecipeSectionInput struct {
	Name          string
	Items         []RecipeItemInput
	Configuration []ConfigurationItemInput
}

type RecipeTest

type RecipeTest struct {
	Name    string
	Type    string
	Message string
	Args    []*TestArgument
}

type RecipeTestInput

type RecipeTestInput struct {
	Name    string
	Message string
	Type    string
	Args    []*TestArgInput
}

type Repository

type Repository struct {
	Id          string
	Name        string
	Description string
	Icon        string
	DarkIcon    string
	Notes       string
	Publisher   *Publisher
	Recipes     []*Recipe
}

type RepositoryEdge

type RepositoryEdge struct {
	Node *Repository
}

type RepositoryInput

type RepositoryInput struct {
	Name          string
	Description   string
	ReleaseStatus string `json:"releaseStatus,omitempty" yaml:"releaseStatus,omitempty"`
	Private       bool   `json:"private" yaml:"private,omitempty"`
	Tags          []Tag  `json:"tags,omitempty" yaml:"tags"`
	Icon          string `json:"icon,omitempty" yaml:"icon"`
	DarkIcon      string `json:"darkIcon,omitempty" yaml:"darkIcon"`
	Docs          string `json:"docs,omitempty" yaml:"docs"`
	Contributors  []string
	Category      string
	Notes         string         `json:"notes,omitempty" yaml:"notes"`
	GitUrl        string         `json:"gitUrl" yaml:"gitUrl"`
	Homepage      string         `json:"homepage" yaml:"homepage"`
	OauthSettings *OauthSettings `yaml:"oauthSettings,omitempty"`
}

func ConstructRepositoryInput

func ConstructRepositoryInput(marshalled []byte) (input *RepositoryInput, err error)

type ResourceDefinitionInput

type ResourceDefinitionInput struct {
	Name string
	Spec []Specification
}

type ScaffoldFile

type ScaffoldFile struct {
	Path    string
	Content string
}

type ScaffoldInputs

type ScaffoldInputs struct {
	Application string `survey:"application"`
	Publisher   string `survey:"publisher"`
	Category    string `survey:"category"`
	Ingress     bool   `survey:"ingress"`
	Postgres    bool   `survey:"postgres"`
}

type Specification

type Specification struct {
	Name     string
	Type     string
	Inner    string `json:"inner,omitempty"`
	Required bool
	Spec     []Specification `json:"spec,omitempty"`
}

type Stack

type Stack struct {
	Id          string
	Name        string
	Provider    string
	Featured    bool
	Description string
	Bundles     []*Recipe
}

type Tag

type Tag struct {
	Tag string
}

type TagAttributes

type TagAttributes struct {
	Tag string
}

type Terraform

type Terraform struct {
	Id             string
	Name           string
	Description    string
	ValuesTemplate string
	Dependencies   *Dependencies
	Package        string
}

func FindTerraform

func FindTerraform(client Client, repo, name string) (*Terraform, error)

type TerraformEdge

type TerraformEdge struct {
	Node *Terraform
}

type TerraformInstallation

type TerraformInstallation struct {
	Id           string
	Installation *Installation
	Terraform    *Terraform
	Version      *Version
}

type TerraformInstallationEdge

type TerraformInstallationEdge struct {
	Node *TerraformInstallation
}

type TestArgInput

type TestArgInput struct {
	Name string
	Repo string
	Key  string
}

type TestArgument

type TestArgument struct {
	Name string
	Repo string
	Key  string
}

type Token

type Token struct {
	Token string
}

type Upgrade

type Upgrade struct {
	Id string
}

type UpgradeInfo

type UpgradeInfo struct {
	Count        int64
	Installation *Installation
}

type User

type User struct {
	Id    string
	Email string
	Name  string
}

type UserEventAttributes

type UserEventAttributes struct {
	Event  string
	Data   string
	Status string
}

type Validation

type Validation struct {
	Type    string
	Regex   string
	Message string
}

type ValidationInput

type ValidationInput struct {
	Type    string
	Regex   string
	Message string
}

type Version

type Version struct {
	Id             string
	Version        string
	Readme         string
	Helm           map[string]interface{}
	Package        string
	ValuesTemplate string
	TemplateType   gqlclient.TemplateType
	Crds           []Crd
	Dependencies   *Dependencies
	InsertedAt     string
}

type VersionAttributes

type VersionAttributes struct {
	Tags []*TagAttributes
}

type VersionEdge

type VersionEdge struct {
	Node *Version
}

type VersionSpec

type VersionSpec struct {
	Repository string
	Chart      *string
	Terraform  *string
	Version    string
}

type Webhook

type Webhook struct {
	Id     string
	Url    string
	Secret string
}

type Wirings

type Wirings struct {
	Terraform map[string]string
	Helm      map[string]string
}

Jump to

Keyboard shortcuts

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