domain

package
v0.0.0-...-7eb25be Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadRequest                 = errors.New("bad-request")
	ErrNotFound                   = errors.New("not-found")
	ErrInternal                   = errors.New("internal")
	ErrInvalidAuthorizationHeader = errors.New("invalid-authorization-header")
	ErrInvalidToken               = errors.New("invalid-token")
	ErrUnauthorized               = errors.New("unauthorized")
	ErrUserNotFound               = errors.New("user-not-found")
	ErrEnvironmentWithNameExists  = errors.New("environment-with-name-exists")
	ErrProjectWithNameExists      = errors.New("project-with-name-exists")
)
View Source
var (
	UserRoleAdmin = "admin"
)

Functions

This section is empty.

Types

type Container

type Container struct {
	ID      string            `json:"id"`
	Name    string            `json:"name"`
	Image   string            `json:"image"`
	ImageID string            `json:"imageId"`
	Status  ContainerStatus   `json:"status"`
	Ports   []ContainerPort   `json:"ports"`
	Volumes []ContainerVolume `json:"volumes"`
}

type ContainerPort

type ContainerPort struct {
	PrivatePort int64  `json:"private_port"`
	PublicPort  int64  `json:"public_port"`
	Type        string `json:"type"`
}

type ContainerPortType

type ContainerPortType string
const (
	ContainerPortTypeTCP ContainerPortType = "tcp"
	ContainerPortTypeUDP ContainerPortType = "udp"
)

type ContainerStatus

type ContainerStatus string
const (
	ContainerStatusRunning ContainerStatus = "running"
	ContainerStatusStopped ContainerStatus = "stopped"
)

type ContainerVolume

type ContainerVolume struct {
	Host      string `json:"host"`
	Container string `json:"container"`
}

type CreateEnvironmentRequest

type CreateEnvironmentRequest struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
}

type CreateProjectRequest

type CreateProjectRequest struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
}

CreateProjectRequest represents a request to create a project.

type Environment

type Environment struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

Environment represents a project environment.

func EnvironmentFromDB

func EnvironmentFromDB(e *db.Environment) *Environment

EnvironmentFromDB converts a db.ProjectEnvironment to an Environment.

func (*Environment) ToDB

func (e *Environment) ToDB() *db.Environment

ToDB converts an Environment to a db.ProjectEnvironment.

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type Project

type Project struct {
	ID          int64     `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	CreatedBy   int64     `json:"created_by"`
	CreatedAt   time.Time `json:"created_at"`
}

Project represents a Diploid project.

func ProjectFromDB

func ProjectFromDB(p *db.Project) *Project

ProjectFromDB converts a db.Project to a Project.

func (*Project) ToDB

func (p *Project) ToDB() *db.Project

ToDB converts a Project to a db.Project.

type UpdateEnvironmentRequest

type UpdateEnvironmentRequest struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

type UpdateProjectRequest

type UpdateProjectRequest struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

type User

type User struct {
	ID        int64     `json:"id"`
	Name      string    `json:"name"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"created_at"`
}

User represents a Diploid user.

func UserFromDB

func UserFromDB(u *db.User) *User

UserFromDB converts a db.User to a User.

func (*User) ToDB

func (u *User) ToDB() *db.User

ToDB converts a User to a db.User.

Jump to

Keyboard shortcuts

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