Documentation ¶
Overview ¶
Example ¶
package main import ( "context" "log" "github.com/mikluko/fakenews" ) func main() { fn := fakenews.NewGenerator(&fakenews.HackernewsSource{Limit: 100, Concurrency: 4}) if err := fn.Init(context.TODO()); err != nil { log.Fatalln(err) } for i := 0; i < 10; i++ { item, err := fn.Generate() if err != nil { log.Fatalln(err) } log.Println(item) } }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
type HackernewsSource ¶
type HackernewsSource struct { Client Client Limit int Concurrency int // contains filtered or unexported fields }
func (*HackernewsSource) Items ¶
func (s *HackernewsSource) Items() []string
Click to show internal directories.
Click to hide internal directories.