Documentation ¶
Index ¶
- Variables
- func ErrorBatchRequest(request string, ids []string, projectId string, err error) error
- func ErrorProviderNotSupported(provider string) error
- type CanBeCreated
- type Client
- func (c *Client) Create(object CanBeCreated) error
- func (c *Client) CreateRepository(name string, description string, private bool) (id string, err error)
- func (c *Client) GetProjectById(projectId string) (*Project, error)
- func (c *Client) GetProjectByIdWithCors(projectId string) (*ProjectReturnWithCors, error)
- func (c *Client) GetRepositoryById(repoId string) (common.Repository, error)
- func (c *Client) GetRepositoryByName(fullName string) (common.Repository, error)
- func (c *Client) Git() common.Client
- func (c *Client) ListRepositories() ([]common.Repository, error)
- func (c *Client) Projects() ([]*Project, error)
- func (c *Client) RegisterDomain(fqdn, projectId string) (response DomainResponse, err error)
- func (c *Client) RegisterRepository(repoId string) error
- func (c *Client) UnregisterRepository(repoId string) error
- func (c *Client) User() *User
- type Cors
- type CreateProjectData
- type Device
- type DomainResponse
- type Project
- type ProjectReturn
- type ProjectReturnWithCors
- type ProjectWithCors
- type ProjectsReturn
- type RawRepoData
- type RawRepoDataOuter
- type Repository
- type User
- type UserData
Constants ¶
This section is empty.
Variables ¶
var ( // CreateRepositoryRetryAttempts is the number of times to retry creating a repository CreateRepositoryRetryAttempts uint = 3 // CreateRepositoryRetryDelay is the delay between retry attempts CreateRepositoryRetryDelay = 300 * time.Millisecond )
Functions ¶
func ErrorBatchRequest ¶
Types ¶
type CanBeCreated ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Create ¶
func (c *Client) Create(object CanBeCreated) error
Create creates the given CanBeCreated object with the current client
func (*Client) CreateRepository ¶
func (c *Client) CreateRepository(name string, description string, private bool) (id string, err error)
CreateRepository creates a new repository on the git provider. Returns the repository id and an error
func (*Client) GetProjectById ¶
GetProjectById returns the project with the given id and an error Note: The repository field is not populated
func (*Client) GetProjectByIdWithCors ¶
func (c *Client) GetProjectByIdWithCors(projectId string) (*ProjectReturnWithCors, error)
GetProjectByIdWithCors returns the project with cors information with the given id and an error
func (*Client) GetRepositoryById ¶
func (c *Client) GetRepositoryById(repoId string) (common.Repository, error)
GetRepositoryById returns a common Repository based on the id and an error
func (*Client) GetRepositoryByName ¶
func (c *Client) GetRepositoryByName(fullName string) (common.Repository, error)
GetRepositoryByName returns a common Repository based on the name and an error
func (*Client) Git ¶
Git returns a git client based on the current git provider Currently only github is supported
func (*Client) ListRepositories ¶
func (c *Client) ListRepositories() ([]common.Repository, error)
ListRepositories returns a list of common Repositories and an error
func (*Client) RegisterDomain ¶
func (c *Client) RegisterDomain(fqdn, projectId string) (response DomainResponse, err error)
RegisterDomain returns information for creating a CNAME record
func (*Client) RegisterRepository ¶
RegisterRepository registers a git repository with the auth server
func (*Client) UnregisterRepository ¶
UnregisterRepository un-registers a git repository from the auth server
type CreateProjectData ¶
type CreateProjectData struct { Config Repository `json:"config"` Code Repository `json:"code"` }
CreateProjectData is the data that is sent to the server to create a new project The repositories only need an id that is registered with the server
type Device ¶
type Device struct { Project *Project Id string `json:"id"` Description string `json:"description"` Enabled bool `json:"enabled"` Name string `json:"name"` PrivateKey string `json:"privateKey"` PublicKey string `json:"publicKey"` Tags []string `json:"tags"` Type string `json:"type"` Env map[string]string `json:"env"` }
Device is the data that is sent to/from the server when getting or updating a device Note: the client and id of the Project are used in calls to the server
type DomainResponse ¶
type Project ¶
type Project struct { Id string `json:"id"` Name string `json:"name"` RepoList *RawRepoDataOuter `json:"Repositories"` // contains filtered or unexported fields }
Project is data which is returned from the server when getting a project Note: filling the RepoList field is a separate call
func (*Project) Config ¶
func (p *Project) Config() (*common.ProjectConfig, error)
Config returns the project configuration and an error The configuration is a "config.yaml" file in the root of the repository
func (*Project) Create ¶
Create creates a new project with the registered config and code repository ids
func (*Project) Repositories ¶
func (p *Project) Repositories() (*RawRepoDataOuter, error)
Repositories will populate then return the repositories field and an error
type ProjectReturn ¶
type ProjectReturn struct {
Project *Project `json:"project"`
}
ProjectReturn is the data that is returned from the server when creating or getting a project
type ProjectReturnWithCors ¶
type ProjectReturnWithCors struct {
Project *ProjectWithCors `json:"project"`
}
ProjectWithCors is the same as ProjectReturn but includes Cors
type ProjectWithCors ¶
type ProjectWithCors struct { Id string `json:"id"` Name string `json:"name"` RepoList *RawRepoDataOuter `json:"Repositories"` Cors Cors `json:"cors"` // contains filtered or unexported fields }
type ProjectsReturn ¶
type ProjectsReturn struct {
Projects []*Project `json:"projects"`
}
ProjectsReturn is the data that is returned from the server when listing projects
type RawRepoData ¶
type RawRepoData struct { Id string `json:"id"` // Not exported by auth.taubyte, must use GetID() Name string `json:"name"` Fullname string `json:"fullname"` Url string `json:"url"` }
RawRepoData is the data that is returned from the server when getting repositories of a project
type RawRepoDataOuter ¶
type RawRepoDataOuter struct { Code RawRepoData `json:"code"` Configuration RawRepoData `json:"configuration"` Provider string `json:"provider"` URL string `json:"url"` }
RawRepoDataOuter is the data that is returned from the server when fetching repositories of a project
type Repository ¶
Repository is the data that is sent to the server to register a repository or for creating a project