Documentation
¶
Index ¶
- Constants
- type IService
- type Service
- func (s *Service) AddNode(ctx context.Context) (*entity.Node, error)
- func (s *Service) DeleteNode(ctx context.Context, id uuid.UUID) error
- func (s *Service) GetNode(ctx context.Context, id uuid.UUID) (*entity.Node, error)
- func (s *Service) ListNodes(ctx context.Context) ([]*entity.Node, error)
- func (s *Service) UpdateNode(ctx context.Context, node *entity.Node) error
Constants ¶
View Source
const ( GetNodeQueryWithContainers = `` /* 136-byte string literal not displayed */ ListNodesQueryWithContainers = ` SELECT n.id, n.status, c.id, c.node_id, c.image, c.status FROM node n LEFT JOIN container c ON n.id = c.node_id` AddNodeQuery = "INSERT INTO node(id, status) VALUES($1, $2)" UpdateNodeQuery = "UPDATE node SET status = $1 WHERE id = $2" DeleteNodeQuery = "DELETE FROM node WHERE id = $1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IService ¶
type IService interface { GetNode(ctx context.Context, id uuid.UUID) (*entity.Node, error) ListNodes(ctx context.Context) ([]*entity.Node, error) AddNode(ctx context.Context) (*entity.Node, error) UpdateNode(ctx context.Context, node *entity.Node) error DeleteNode(ctx context.Context, id uuid.UUID) error }
Click to show internal directories.
Click to hide internal directories.