Documentation
¶
Overview ¶
Package network manages Docker networks owned by workspaces. The platform owns the full lifecycle: each workspace gets a default network on creation, and the Docker network is created/removed alongside the database record.
Index ¶
- Variables
- type Input
- type Service
- func (s *Service) Create(ctx context.Context, workspaceID uint, in Input) (*models.Network, error)
- func (s *Service) Delete(ctx context.Context, workspaceID, id uint) error
- func (s *Service) EnsureDefault(ctx context.Context, workspaceID uint) (*models.Network, error)
- func (s *Service) Get(workspaceID, id uint) (*models.Network, error)
- func (s *Service) List(workspaceID uint) ([]models.Network, error)
- func (s *Service) SetAllocator(a *netalloc.Service)
- func (s *Service) SetQuota(q *quota.Service)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNameRequired = errors.New("network name is required") ErrNameTaken = errors.New("a network with this name already exists") ErrNotFound = errors.New("network not found") ErrInUse = errors.New("network is attached to one or more applications") ErrIsDefault = errors.New("the default network cannot be deleted") ErrInvalidDriver = errors.New("unsupported network driver") )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo *repositories.NetworkRepository, dockerClient docker.Client) *Service
func (*Service) EnsureDefault ¶
EnsureDefault creates the workspace's default network if it has none.
func (*Service) SetAllocator ¶
SetAllocator wires the subnet allocator so managed networks get a Miabi-carved subnet instead of Docker's default pool (nil-safe; nil = Docker default pool).
Click to show internal directories.
Click to hide internal directories.