Documentation
¶
Index ¶
- Variables
- func SelectNodeIDs(script string, nodes []ProxyNodeView) ([]int64, error)
- type CreateGroupInput
- type Handler
- type ProxyGroup
- type ProxyNodeView
- type Repository
- func (r *Repository) Create(ctx context.Context, g ProxyGroup) (ProxyGroup, error)
- func (r *Repository) Delete(ctx context.Context, id int64) error
- func (r *Repository) GetByID(ctx context.Context, id int64) (ProxyGroup, error)
- func (r *Repository) List(ctx context.Context) ([]ProxyGroup, error)
- func (r *Repository) ListProxyNodeViews(ctx context.Context) ([]ProxyNodeView, error)
- func (r *Repository) ListRawNodesByProviders(ctx context.Context, providerIDs []int64) ([]ResolvedNode, error)
- func (r *Repository) Update(ctx context.Context, g ProxyGroup) (ProxyGroup, error)
- type ResolvedNode
- type Service
- func (s *Service) Create(ctx context.Context, in CreateGroupInput) (ProxyGroup, error)
- func (s *Service) Delete(ctx context.Context, id int64) error
- func (s *Service) GetByID(ctx context.Context, id int64) (ProxyGroup, error)
- func (s *Service) List(ctx context.Context) ([]ProxyGroup, error)
- func (s *Service) ListNodes(ctx context.Context, groupID int64) ([]ProxyNodeView, error)
- func (s *Service) ResolveNodesForOutput(ctx context.Context, groupID int64, allowedProviderIDs []int64) ([]string, []map[string]any, error)
- func (s *Service) Update(ctx context.Context, id int64, in UpdateGroupInput) (ProxyGroup, error)
- type UpdateGroupInput
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDeleteReferenced = errors.New("proxy group is referenced by other resources")
View Source
var ErrNameRequired = errors.New("name is required")
View Source
var ErrNotFound = errors.New("proxy group not found")
Functions ¶
func SelectNodeIDs ¶
func SelectNodeIDs(script string, nodes []ProxyNodeView) ([]int64, error)
Types ¶
type CreateGroupInput ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) RegisterRoutes ¶
type ProxyGroup ¶
type ProxyNodeView ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *sql.DB) *Repository
func (*Repository) Create ¶
func (r *Repository) Create(ctx context.Context, g ProxyGroup) (ProxyGroup, error)
func (*Repository) GetByID ¶
func (r *Repository) GetByID(ctx context.Context, id int64) (ProxyGroup, error)
func (*Repository) List ¶
func (r *Repository) List(ctx context.Context) ([]ProxyGroup, error)
func (*Repository) ListProxyNodeViews ¶
func (r *Repository) ListProxyNodeViews(ctx context.Context) ([]ProxyNodeView, error)
func (*Repository) ListRawNodesByProviders ¶
func (r *Repository) ListRawNodesByProviders(ctx context.Context, providerIDs []int64) ([]ResolvedNode, error)
func (*Repository) Update ¶
func (r *Repository) Update(ctx context.Context, g ProxyGroup) (ProxyGroup, error)
type ResolvedNode ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo *Repository) *Service
func (*Service) Create ¶
func (s *Service) Create(ctx context.Context, in CreateGroupInput) (ProxyGroup, error)
func (*Service) ResolveNodesForOutput ¶
func (*Service) Update ¶
func (s *Service) Update(ctx context.Context, id int64, in UpdateGroupInput) (ProxyGroup, error)
type UpdateGroupInput ¶
Click to show internal directories.
Click to hide internal directories.