Documentation ¶
Index ¶
- func LoadRoutes(r chi.Router, config config.Config, store *store.PostgresStore)
- type Link
- type LinkIdReq
- type LinkReq
- type LinkResp
- type LinksHandler
- type LinksService
- type PostgresRepository
- func (repo *PostgresRepository) CreateLink(ctx context.Context, link *Link) (*Link, error)
- func (repo *PostgresRepository) GetLink(ctx context.Context, id string, userId string) (*Link, error)
- func (repo *PostgresRepository) GetLinksByFolderId(ctx context.Context, folderId string, userId string) ([]*Link, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadRoutes ¶
func LoadRoutes(r chi.Router, config config.Config, store *store.PostgresStore)
Types ¶
type Link ¶
type Link struct { CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt *time.Time `db:"updated_at" json:"updated_at"` FolderId *string `db:"folder_id" validate:"omitempty,uuid" json:"folder_id"` ExpiresAt *time.Time `db:"expires_at" validate:"omitempty,expires_at" json:"expires_at"` Id string `db:"id" json:"id"` LinktlyCode string `db:"linktly_code" validate:"omitempty,http_url" json:"linktly_url"` Url string `db:"url" validate:"http_url" json:"url"` Name string `db:"name" validate:"required,min=3,max=255" json:"name"` AccountId string `db:"account_id" validate:"omitempty,uuid" json:"account_id"` Description string `db:"description" validate:"min=10" json:"description"` }
type LinksHandler ¶
type LinksHandler struct {
// contains filtered or unexported fields
}
func (LinksHandler) CreateLink ¶
func (l LinksHandler) CreateLink(w http.ResponseWriter, r *http.Request) error
func (LinksHandler) GetLink ¶
func (l LinksHandler) GetLink(w http.ResponseWriter, r *http.Request) error
type LinksService ¶
type LinksService struct {
Repository linksRepository
}
func (*LinksService) CreateLink ¶
type PostgresRepository ¶
type PostgresRepository struct {
// contains filtered or unexported fields
}
func GetNewLinkRepository ¶
func GetNewLinkRepository(store *store.PostgresStore) *PostgresRepository
func (*PostgresRepository) CreateLink ¶
func (*PostgresRepository) GetLinksByFolderId ¶
Click to show internal directories.
Click to hide internal directories.