dto

package
v0.4.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToProject

func ToProject(projectDTO ProjectDTO) *types.Project

func ToRepository

func ToRepository(repoDTO RepositoryDTO) *types.Repository

func ToWorkspace

func ToWorkspace(workspaceDTO WorkspaceDTO) *types.Workspace

Types

type ProjectDTO

type ProjectDTO struct {
	Name        string        `json:"name"`
	Repository  RepositoryDTO `json:"repository"`
	WorkspaceId string        `json:"workspaceId"`
	ApiKey      string        `json:"apiKey"`
	Target      string        `json:"target"`
}

func ToProjectDTO

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

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 *types.Repository) 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 *types.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