Documentation
¶
Index ¶
- Constants
- Variables
- func Module() fx.Option
- type CreateTargetInput
- type Repository
- func (r *Repository) Create(ctx context.Context, userID string, in CreateTargetInput) (*Target, error)
- func (r *Repository) Delete(ctx context.Context, userID string, targetID string) error
- func (r *Repository) GetByID(ctx context.Context, id string) (*Target, error)
- func (r *Repository) ListByOwner(ctx context.Context, ownerUserID string) ([]Target, error)
- func (r *Repository) ListPublic(ctx context.Context) ([]Target, error)
- func (r *Repository) Update(ctx context.Context, userID string, id string, in UpdateTargetInput) (*Target, error)
- type Service
- func (s *Service) Create(ctx context.Context, userID string, in CreateTargetInput) (*Target, error)
- func (s *Service) Delete(ctx context.Context, userID string, targetID string) error
- func (s *Service) GetByID(ctx context.Context, userID string, targetID string) (*Target, error)
- func (s *Service) ListOwned(ctx context.Context, userID string) ([]Target, error)
- func (s *Service) ListPublic(ctx context.Context) ([]Target, error)
- func (s *Service) Update(ctx context.Context, userID string, id string, in UpdateTargetInput) (*Target, error)
- type Status
- type Target
- type UpdateTargetInput
- type Visibility
Constants ¶
View Source
const ( ParamTimeoutSeconds = "timeout_seconds" ParamRetries = "retries" ParamIntervalSeconds = "interval_seconds" )
Variables ¶
Functions ¶
Types ¶
type CreateTargetInput ¶
type CreateTargetInput struct {
Name string
Endpoint string
Description string
Visibility Visibility
CheckParams map[string]string
}
func (*CreateTargetInput) Validate ¶
func (in *CreateTargetInput) Validate() error
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *bun.DB) *Repository
func (*Repository) Create ¶
func (r *Repository) Create(ctx context.Context, userID string, in CreateTargetInput) (*Target, error)
func (*Repository) ListByOwner ¶
func (*Repository) ListPublic ¶
func (r *Repository) ListPublic(ctx context.Context) ([]Target, error)
func (*Repository) Update ¶
func (r *Repository) Update(ctx context.Context, userID string, id string, in UpdateTargetInput) (*Target, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(targets *Repository) *Service
type UpdateTargetInput ¶
type UpdateTargetInput = CreateTargetInput
type Visibility ¶
type Visibility string
const ( VisibilityPrivate Visibility = "private" // Visible to the private agents only VisibilityInternal Visibility = "internal" // Visible to the private and service-provided agents VisibilityPublic Visibility = "public" // Visible to the any agents )
Click to show internal directories.
Click to hide internal directories.