Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidFileType = errors.New("invalid file type")
)
Functions ¶
func MakeDocumentHandler ¶
func MakeDocumentHandler(mr *mux.Router, service DocumentService) http.Handler
Types ¶
type Document ¶
type Document struct { ID string `json:"id"` DisplayName string `json:"display_name"` Name string `json:"name"` Path string `json:"path"` Type string `json:"type"` Description string `json:"description"` Tags []string `json:"tag_ids"` Created time.Time `json:"created"` Updated *time.Time `json:"updated"` }
type DocumentRepository ¶
type DocumentRepository interface { FindAll(ctx context.Context, filter map[string]interface{}) ([]*Document, error) FindByID(ctx context.Context, id string) (*Document, error) Insert(ctx context.Context, document *Document) error Delete(ctx context.Context, id string) error UpdateDocument(ctx context.Context, document Document) (Document, error) UpsertStream(ctx context.Context, input <-chan *Document) error }
type DocumentService ¶
type DocumentService interface { FindAll(ctx context.Context, filter map[string]interface{}) ([]*Document, error) FindByID(ctx context.Context, id string) (*Document, error) Add(ctx context.Context, file multipart.File, document *Document) error Delete(ctx context.Context, id string) error Scan(ctx context.Context) error UpdateFields(ctx context.Context, id string, docs Document) (Document, error) }
func NewDocumentService ¶
func NewDocumentService(storage common.DocumentStorage, repo DocumentRepository) DocumentService
Click to show internal directories.
Click to hide internal directories.