Added RSS and JSON feeds
This commit is contained in:
parent
65e5ce2733
commit
21f181f83d
13 changed files with 192 additions and 31 deletions
10
models/iters.go
Normal file
10
models/iters.go
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
package models
|
||||
|
||||
type Maybe[T any] struct {
|
||||
Value T
|
||||
Err error
|
||||
}
|
||||
|
||||
func (m Maybe[T]) Get() (T, error) {
|
||||
return m.Value, m.Err
|
||||
}
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
package pubmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"iter"
|
||||
|
||||
"lmika.dev/lmika/weiro/models"
|
||||
)
|
||||
|
|
@ -9,8 +11,11 @@ import (
|
|||
type Site struct {
|
||||
models.Site
|
||||
BaseURL string
|
||||
Posts []*models.Post
|
||||
//Posts []*models.Post
|
||||
Uploads []models.Upload
|
||||
|
||||
OpenUpload func(u models.Upload) (io.ReadCloser, error)
|
||||
|
||||
// PostItr returns a new post iterator
|
||||
PostIter func(ctx context.Context) iter.Seq[models.Maybe[*models.Post]]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue