Documentation ¶
Overview ¶
Package harness provides a Harness http client.
Index ¶
- Constants
- func WaitHarnessSecretManager(client Client, org, project string) error
- func WaitHarnessSecretManagerOrg(client Client, org string) error
- type Client
- type Connector
- type ConnectorDocker
- type ConnectorGithub
- type ConnectorGitlab
- type ConnectorToken
- type Error
- type Option
- type Org
- type Pipeline
- type Project
- type Repository
- type RepositoryCreateRequest
- type Resource
- type Secret
- type SecretText
Constants ¶
const ( // DefaultSecretType defines the default secret type. DefaultSecretType = "SecretText" // DefaultSecretType defines the default secret value type. DefaultSecretValueType = "Inline" // DefaultSecretManager defines the default secret manager. DefaultSecretManager = "harnessSecretManager" )
const ( ConnectorTypeGithub = "Github" ConnectorTypeGitlab = "Gitlab" )
Variables ¶
This section is empty.
Functions ¶
func WaitHarnessSecretManager ¶
WaitHarnessSecretManager blocks until the harness secret manager is created for the project.
func WaitHarnessSecretManagerOrg ¶
WaitHarnessSecretManagerOrg blocks until the harness secret manager is created for the organization.
Types ¶
type Client ¶
type Client interface { // FindOrg returns an organization by identifier. FindOrg(id string) (*Org, error) // FindProject returns a project by organization and // identifier. FindProject(org, id string) (*Project, error) // FindPipeline returns a pipeline by organization, // project and identifer. FindPipeline(org, project, id string) (*Pipeline, error) // FindSecret returns a secret by organization, project // and identifer. FindSecret(org, project, id string) (*Secret, error) // FindSecretOrg returns a secret by organization and // identifer. FindSecretOrg(org, id string) (*Secret, error) // FindConnector returns a connector by organization, // project and identifer. FindConnector(org, project, id string) (*Connector, error) // FindConnectorOrg returns a connector by organization // and identifer. FindConnectorOrg(org, id string) (*Connector, error) // CreateOrg creates an organization. CreateOrg(org *Org) error // CreateProject creates a project. CreateProject(project *Project) error // CreateSecret creates a secret. CreateSecret(secret *Secret) error // CreateSecret creates an organization secret. CreateSecretOrg(secret *Secret) error // CreateConnector creates a connector. CreateConnector(connector *Connector) error // CreateConnector creates an organization connector. CreateConnectorOrg(connector *Connector) error // CreatePipeline creates a pipeline for the // organization and pipeline identifier, with the // given identifier and name. CreatePipeline(org, project string, pipeline []byte) error // CreateRepository creates a repository. CreateRepository(org, project string, repo *RepositoryCreateRequest) (*Repository, error) }
Client is used to communicate with the Harness server.
type Connector ¶
type Connector struct { Name string `json:"name"` Identifier string `json:"identifier"` Orgidentifier string `json:"orgIdentifier,omitempty"` Projectidentifier string `json:"projectIdentifier,omitempty"` Version int `json:"version,omitempty"` Numofstages int `json:"numOfStages,omitempty"` Createdat int64 `json:"createdAt,omitempty"` Lastupdatedat int64 `json:"lastUpdatedAt,omitempty"` Type string `json:"type"` // Gitlab, Github Spec interface{} `json:"spec"` }
Connector defines a connector.
type ConnectorDocker ¶
type ConnectorGithub ¶
type ConnectorGithub struct { Executeondelegate bool `json:"executeOnDelegate"` Type string `json:"type"` // Account URL string `json:"url"` Validationrepo string `json:"validationRepo,omitempty"` Authentication *Resource `json:"authentication"` Apiaccess *Resource `json:"apiAccess"` }
ConnectorGithub defines a Github connector.
type ConnectorGitlab ¶
type ConnectorGitlab struct { Executeondelegate bool `json:"executeOnDelegate"` Type string `json:"type"` // Account URL string `json:"url"` Validationrepo string `json:"validationRepo,omitempty"` Authentication *Resource `json:"authentication"` Apiaccess *Resource `json:"apiAccess"` }
ConnectorGitlab defines a Gitlab connector.
type ConnectorToken ¶
type ConnectorToken struct { Username string `json:"username,omitempty"` Tokenref string `json:"tokenRef,omitempty"` }
ConnectorToken defines connector credentials.
type Option ¶
type Option func(*client)
Option configures a Digital Ocean provider option.
func WithAddress ¶
WithAddress returns an option to set the base address.
func WithTracing ¶
WithTracing returns an option to enable tracing.
type Org ¶
type Org struct { ID string `json:"identifier"` Name string `json:"name"` Desc string `json:"description"` }
Org defines an organization.
type Pipeline ¶
type Pipeline struct { Name string `json:"name"` Identifier string `json:"identifier"` Version int `json:"version"` Numofstages int `json:"numOfStages"` Createdat int64 `json:"createdAt"` Lastupdatedat int64 `json:"lastUpdatedAt"` }
Pipeline defines a pipeline.
type Project ¶
type Project struct { Orgidentifier string `json:"orgIdentifier"` Identifier string `json:"identifier"` Name string `json:"name"` Color string `json:"color,omitempty"` Modules []string `json:"modules,omitempty"` Description string `json:"description,omitempty"` }
Project defines a project.
type Repository ¶
type Repository struct { UID string `json:"uid"` ParentID int64 `json:"parent_id"` Description string `json:"description"` IsPublic bool `json:"is_public"` DefaultBranch string `json:"default_branch"` GitURL string `json:"git_url"` }
Repository defines a resository.
type RepositoryCreateRequest ¶
type RepositoryCreateRequest struct { UID string `json:"uid"` DefaultBranch string `json:"default_branch"` Description string `json:"description"` IsPublic bool `json:"is_public"` }
RepositoryCreateRequest defines a repo creation request.
type Resource ¶
type Resource struct { Type string `json:"type"` Spec interface{} `json:"spec"` }
Resource defines a base resource.
type Secret ¶
type Secret struct { Name string `json:"name"` Identifier string `json:"identifier"` Orgidentifier string `json:"orgIdentifier,omitempty"` Projectidentifier string `json:"projectIdentifier,omitempty"` Description string `json:"description,omitempty"` Type string `json:"type"` // SecretText Spec *SecretText `json:"spec"` }