Documentation
¶
Index ¶
- Variables
- type CreateRuleInput
- type CreateRuleRecord
- type Handler
- type ImportRulesInput
- type ImportRulesResult
- type ListRulesInput
- type ListRulesResult
- type Repository
- func (r *Repository) BatchImport(ctx context.Context, records []CreateRuleRecord) (int, error)
- func (r *Repository) Create(ctx context.Context, rec CreateRuleRecord) (Rule, error)
- func (r *Repository) Delete(ctx context.Context, id int64) error
- func (r *Repository) FindProxyGroupIDByName(ctx context.Context, name string) (int64, error)
- func (r *Repository) GetByID(ctx context.Context, id int64) (Rule, error)
- func (r *Repository) List(ctx context.Context, in ListRulesInput) ([]Rule, int, error)
- func (r *Repository) ListAscendingForOutput(ctx context.Context) ([]RuleOutputRow, error)
- func (r *Repository) ListForInternalGroup(ctx context.Context, groupID int64) ([]string, error)
- func (r *Repository) ListForOutput(ctx context.Context) ([]string, error)
- func (r *Repository) Update(ctx context.Context, id int64, rec CreateRuleRecord) (Rule, error)
- type Rule
- type RuleOutputRow
- type Service
- func (s *Service) Create(ctx context.Context, in CreateRuleInput) (Rule, error)
- func (s *Service) Delete(ctx context.Context, id int64) error
- func (s *Service) GetByID(ctx context.Context, id int64) (Rule, error)
- func (s *Service) Import(ctx context.Context, in ImportRulesInput) (*ImportRulesResult, error)
- func (s *Service) List(ctx context.Context, in ListRulesInput) (*ListRulesResult, error)
- func (s *Service) Update(ctx context.Context, id int64, in UpdateRuleInput) (Rule, error)
- type UpdateRuleInput
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRuleTypeRequired = errors.New("rule type is required") ErrPatternRequired = errors.New("pattern is required") ErrProxyGroupRequired = errors.New("proxy group is required") ErrInvalidProxyGroup = errors.New("invalid proxy group") )
View Source
var ErrNotFound = errors.New("rule not found")
Functions ¶
This section is empty.
Types ¶
type CreateRuleInput ¶
type CreateRuleRecord ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) RegisterRoutes ¶
type ImportRulesInput ¶
type ImportRulesResult ¶
type ListRulesInput ¶
type ListRulesResult ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *sql.DB) *Repository
func (*Repository) BatchImport ¶
func (r *Repository) BatchImport(ctx context.Context, records []CreateRuleRecord) (int, error)
func (*Repository) Create ¶
func (r *Repository) Create(ctx context.Context, rec CreateRuleRecord) (Rule, error)
func (*Repository) FindProxyGroupIDByName ¶
func (*Repository) List ¶
func (r *Repository) List(ctx context.Context, in ListRulesInput) ([]Rule, int, error)
func (*Repository) ListAscendingForOutput ¶
func (r *Repository) ListAscendingForOutput(ctx context.Context) ([]RuleOutputRow, error)
func (*Repository) ListForInternalGroup ¶
func (*Repository) ListForOutput ¶
func (r *Repository) ListForOutput(ctx context.Context) ([]string, error)
func (*Repository) Update ¶
func (r *Repository) Update(ctx context.Context, id int64, rec CreateRuleRecord) (Rule, error)
type RuleOutputRow ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo *Repository) *Service
func (*Service) Import ¶
func (s *Service) Import(ctx context.Context, in ImportRulesInput) (*ImportRulesResult, error)
func (*Service) List ¶
func (s *Service) List(ctx context.Context, in ListRulesInput) (*ListRulesResult, error)
type UpdateRuleInput ¶
Click to show internal directories.
Click to hide internal directories.