dto

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToApiKey

func ToApiKey(apiKeyDTO ApiKeyDTO) apikey.ApiKey

func ToGitProviderConfig

func ToGitProviderConfig(gitProviderDTO GitProviderConfigDTO) gitprovider.GitProviderConfig

func ToProject

func ToProject(projectDTO ProjectDTO) *workspace.Project

func ToProjectState

func ToProjectState(stateDTO *ProjectStateDTO) *workspace.ProjectState

func ToProviderTarget

func ToProviderTarget(providerTargetDTO ProviderTargetDTO) *provider.ProviderTarget

func ToRepository

func ToRepository(repoDTO RepositoryDTO) *gitprovider.GitRepository

func ToWorkspace

func ToWorkspace(workspaceDTO WorkspaceDTO) *workspace.Workspace

Types

type ApiKeyDTO

type ApiKeyDTO struct {
	KeyHash string `gorm:"primaryKey"`
	Type    apikey.ApiKeyType
	Name    string `gorm:"uniqueIndex"`
}

func ToApiKeyDTO

func ToApiKeyDTO(apiKey apikey.ApiKey) ApiKeyDTO

type GitProviderConfigDTO

type GitProviderConfigDTO struct {
	Id         string  `gorm:"primaryKey"`
	Username   string  `json:"username"`
	Token      string  `json:"token"`
	BaseApiUrl *string `json:"baseApiUrl,omitempty"`
}

func ToGitProviderConfigDTO

func ToGitProviderConfigDTO(gitProvider gitprovider.GitProviderConfig) GitProviderConfigDTO

type ProjectDTO

type ProjectDTO struct {
	Name        string           `json:"name"`
	Repository  RepositoryDTO    `json:"repository"`
	WorkspaceId string           `json:"workspaceId"`
	Target      string           `json:"target"`
	State       *ProjectStateDTO `json:"state,omitempty" gorm:"serializer:json"`
}

func ToProjectDTO

func ToProjectDTO(project *workspace.Project, workspace *workspace.Workspace) ProjectDTO

type ProjectStateDTO

type ProjectStateDTO struct {
	UpdatedAt string `json:"updatedAt"`
	Uptime    uint64 `json:"uptime"`
}

func ToProjectStateDTO

func ToProjectStateDTO(state *workspace.ProjectState) *ProjectStateDTO

type ProviderTargetDTO

type ProviderTargetDTO struct {
	Name            string `json:"name" gorm:"primaryKey"`
	ProviderName    string `json:"providerName"`
	ProviderVersion string `json:"providerVersion"`
	Options         string `json:"options"`
}

func ToProviderTargetDTO

func ToProviderTargetDTO(providerTarget *provider.ProviderTarget) ProviderTargetDTO

type RepositoryDTO

type RepositoryDTO struct {
	Url      string  `json:"url"`
	Branch   *string `default:"main" json:"branch,omitempty"`
	SHA      *string `json:"sha,omitempty"`
	Owner    *string `json:"owner,omitempty"`
	PrNumber *uint32 `json:"prNumber,omitempty"`
	Source   *string `json:"source,omitempty"`
	Path     *string `json:"path,omitempty"`
}

func ToRepositoryDTO

func ToRepositoryDTO(repo *gitprovider.GitRepository) RepositoryDTO

type WorkspaceDTO

type WorkspaceDTO struct {
	Id       string       `gorm:"primaryKey"`
	Name     string       `json:"name" gorm:"unique"`
	Target   string       `json:"target"`
	Projects []ProjectDTO `gorm:"serializer:json"`
}

func ToWorkspaceDTO

func ToWorkspaceDTO(workspace *workspace.Workspace) WorkspaceDTO

func (WorkspaceDTO) GetProject

func (w WorkspaceDTO) GetProject(name string) (*ProjectDTO, error)

Jump to

Keyboard shortcuts

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