dir2opds/opds/text_builder.go
2018-03-03 15:31:42 -05:00

24 lines
568 B
Go

package opds
import (
"github.com/lann/builder"
"golang.org/x/tools/blog/atom"
)
type textBuilder builder.Builder
func (t textBuilder) Type(textType string) textBuilder {
return builder.Set(t, "Type", textType).(textBuilder)
}
func (t textBuilder) Body(body string) textBuilder {
return builder.Set(t, "Body", body).(textBuilder)
}
func (t textBuilder) Build() atom.Text {
return builder.GetStruct(t).(atom.Text)
}
// TextBuilder is a fluent immutable builder to build OPDS texts
var TextBuilder = builder.Register(textBuilder{}, atom.Text{}).(textBuilder)