{"modulePath":"github.com/devth/helm","version":"v1.2.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package common\n\n## Types\n\n```go\ntype APITokenCredential string\n```\nAPITokenCredential defines an API token.\n\n```go\ntype BasicAuthCredential struct {\n\tUsername string `json:\"username\"`\n\tPassword string `json:\"password\"`\n}\n```\nBasicAuthCredential holds a username and password.\n\n```go\ntype Configuration struct {\n\tResources []*Resource `json:\"resources\"`\n}\n```\nConfiguration describes a set of resources in a form that can be instantiated.\n\n```go\ntype CredentialProvider interface {\n\t// Set the credential for a registry.\n\t// May not be supported by some registry services.\n\tSetCredential(name string, credential *RegistryCredential) error\n\n\t// GetCredential returns the specified credential or nil if there's no credential.\n\t// Error is non-nil if fetching the credential failed.\n\tGetCredential(name string) (*RegistryCredential, error)\n}\n```\nCredentialProvider provides credentials for registries.\n\n```go\ntype Deployment struct {\n\tName           string           `json:\"name\"`\n\tCreatedAt      time.Time        `json:\"createdAt,omitempty\"`\n\tDeployedAt     time.Time        `json:\"deployedAt,omitempty\"`\n\tModifiedAt     time.Time        `json:\"modifiedAt,omitempty\"`\n\tDeletedAt      time.Time        `json:\"deletedAt,omitempty\"`\n\tState          *DeploymentState `json:\"state,omitempty\"`\n\tLatestManifest string           `json:\"latestManifest,omitEmpty\"`\n}\n```\nDeployment defines a deployment that describes the creation, modification and/or deletion of a set of resources.\n\n```go\nfunc NewDeployment(name string) *Deployment\n```\nNewDeployment creates a new deployment.\n\n```go\ntype DeploymentState struct {\n\tStatus DeploymentStatus `json:\"status,omitempty\"`\n\tErrors []string         `json:\"errors,omitempty\"`\n}\n```\nDeploymentState describes the state of a resource. It is set to the terminal state depending on the outcome of an operation on the deployment.\n\n```go\ntype DeploymentStatus string\n```\nDeploymentStatus is an enumeration type for the status of a deployment.\n\n```go\nconst (\n\tCreatedStatus  DeploymentStatus = \"Created\"\n\tDeletedStatus  DeploymentStatus = \"Deleted\"\n\tDeployedStatus DeploymentStatus = \"Deployed\"\n\tFailedStatus   DeploymentStatus = \"Failed\"\n\tModifiedStatus DeploymentStatus = \"Modified\"\n)\n```\nThese constants implement the DeploymentStatus enumeration type.\n\n```go\nfunc (s DeploymentStatus) String() string\n```\n\n```go\ntype ImportFile struct {\n\tName    string `json:\"name,omitempty\"`\n\tPath    string `json:\"path,omitempty\"` // Actual URL for the file\n\tContent string `json:\"content\"`\n}\n```\nImportFile describes a base64 encoded file imported by a Template.\n\n```go\ntype JWTTokenCredential string\n```\nJWTTokenCredential defines a JWT token.\n\n```go\ntype KubernetesObject struct {\n\tKind       string                 `json:\"kind\"`\n\tAPIVersion string                 `json:\"apiVersion\"`\n\tMetadata   map[string]interface{} `json:\"metadata\"`\n\tSpec       map[string]interface{} `json:\"spec\"`\n}\n```\nKubernetesObject represents a native 'bare' Kubernetes object.\n\n```go\ntype KubernetesSecret struct {\n\tKind       string            `json:\"kind\"`\n\tAPIVersion string            `json:\"apiVersion\"`\n\tMetadata   map[string]string `json:\"metadata\"`\n\tData       map[string]string `json:\"data,omitempty\"`\n}\n```\nKubernetesSecret represents a Kubernetes secret\n\n```go\ntype Layout struct {\n\tResources []*LayoutResource `json:\"resources,omitempty\"`\n}\n```\nLayout defines the structure of a layout as returned from expansion.\n\n```go\ntype LayoutResource struct {\n\tResource\n\tLayout\n}\n```\nLayoutResource defines the structure of resources in the manifest layout.\n\n```go\ntype Manifest struct {\n\tDeployment     string         `json:\"deployment,omitempty\"`\n\tName           string         `json:\"name,omitempty\"`\n\tInputConfig    *Template      `json:\"inputConfig,omitempty\"`\n\tExpandedConfig *Configuration `json:\"expandedConfig,omitempty\"`\n\tLayout         *Layout        `json:\"layout,omitempty\"`\n}\n```\nManifest contains the input configuration for a deployment, the fully expanded configuration, and the layout structure of the manifest.\n\n```go\ntype Registry struct {\n\tName           string         `json:\"name,omitempty\"`           // Friendly name for the registry\n\tType           RegistryType   `json:\"type,omitempty\"`           // Technology implementing the registry\n\tURL            string         `json:\"url,omitempty\"`            // URL to the root of the registry\n\tFormat         RegistryFormat `json:\"format,omitempty\"`         // Format of the registry\n\tCredentialName string         `json:\"credentialname,omitempty\"` // Name of the credential to use\n}\n```\nRegistry describes a template registry TODO(jackr): Fix ambiguity re: whether or not URL has a scheme.\n\n```go\ntype RegistryCredential struct {\n\tAPIToken       APITokenCredential  `json:\"apitoken,omitempty\"`\n\tBasicAuth      BasicAuthCredential `json:\"basicauth,omitempty\"`\n\tServiceAccount JWTTokenCredential  `json:\"serviceaccount,omitempty\"`\n}\n```\nRegistryCredential holds a credential used to access a registry.\n\n```go\ntype RegistryFormat string\n```\nRegistryFormat is a semi-colon delimited string that describes the format of a registry.\n\n```go\nconst (\n\n\t// VersionedRegistry identifies a versioned registry, where types appear under versions.\n\tVersionedRegistry RegistryFormat = \"versioned\"\n\t// UnversionedRegistry identifies an unversioned registry, where types appear under their names.\n\tUnversionedRegistry RegistryFormat = \"unversioned\"\n\n\t// CollectionRegistry identfies a collection registry, where types are grouped into collections.\n\tCollectionRegistry RegistryFormat = \"collection\"\n\t// OneLevelRegistry identifies a one level registry, where all types appear at the top level.\n\tOneLevelRegistry RegistryFormat = \"onelevel\"\n)\n```\n\n```go\ntype RegistryService interface {\n\t// List all the registries\n\tList() ([]*Registry, error)\n\t// Create a new registry\n\tCreate(registry *Registry) error\n\t// Get a registry\n\tGet(name string) (*Registry, error)\n\t// Get a registry with credential.\n\tGetRegistry(name string) (*Registry, error)\n\t// Delete a registry\n\tDelete(name string) error\n\t// Find a registry that backs the given URL\n\tGetByURL(URL string) (*Registry, error)\n\t// GetRegistryByURL returns a registry that handles the types for a given URL.\n\tGetRegistryByURL(URL string) (*Registry, error)\n}\n```\nRegistryService maintains a set of registries that defines the scope of all registry based operations, such as search and type resolution.\n\n```go\ntype RegistryType string\n```\nRegistryType defines the technology that implements the registry\n\n```go\nconst (\n\tGithubRegistryType RegistryType = \"github\"\n\tGCSRegistryType    RegistryType = \"gcs\"\n)\n```\nConstants that identify the supported registry layouts.\n\n```go\ntype Resource struct {\n\tName       string                 `json:\"name\"`\n\tType       string                 `json:\"type\"`\n\tProperties map[string]interface{} `json:\"properties,omitempty\"`\n\tState      *ResourceState         `json:\"state,omitempty\"`\n}\n```\nResource describes a resource in a configuration. A resource has a name, a type and a set of properties. The name and type are used to identify the resource in Kubernetes. The properties are passed to Kubernetes as the resource configuration.\n\n```go\ntype ResourceState struct {\n\tStatus   ResourceStatus `json:\"status,omitempty\"`\n\tSelfLink string         `json:\"selflink,omitempty\"`\n\tErrors   []string       `json:\"errors,omitempty\"`\n}\n```\nResourceState describes the state of a resource. Status is set during resource creation and is a terminal state.\n\n```go\ntype ResourceStatus string\n```\nResourceStatus is an enumeration type for the status of a resource.\n\n```go\nconst (\n\tCreated ResourceStatus = \"Created\"\n\tFailed  ResourceStatus = \"Failed\"\n\tAborted ResourceStatus = \"Aborted\"\n)\n```\nThese constants implement the resourceStatus enumeration type.\n\n```go\ntype Schema struct {\n\tImports []SchemaImport `json:\"imports\"`\n}\n```\nSchema is a partial DM schema. We only need access to the imports object at this level.\n\n```go\ntype SchemaImport struct {\n\tPath string `json:\"path\"`\n\tName string `json:\"name\"`\n}\n```\nSchemaImport represents an import as declared in a schema file.\n\n```go\ntype Template struct {\n\tName    string        `json:\"name\"`\n\tContent string        `json:\"content\"`\n\tImports []*ImportFile `json:\"imports\"`\n}\n```\nTemplate describes a set of resources to be deployed. Manager expands a Template into a Configuration, which describes the set in a form that can be instantiated.\n\n```go\ntype TypeInstance struct {\n\tName       string `json:\"name\"`       // instance name\n\tType       string `json:\"type\"`       // instance type\n\tDeployment string `json:\"deployment\"` // deployment name\n\tManifest   string `json:\"manifest\"`   // manifest name\n\tPath       string `json:\"path\"`       // JSON path within manifest\n}\n```\nTypeInstance defines the metadata for an instantiation of a template type in a deployment.\n\n","path":"github.com/devth/helm/common","name":"common","synopsis":"","isRedistributable":true}
