Documentation
¶
Index ¶
- Variables
- type Bot
- type BotOpts
- type CompositeGenerator
- type Fetcher
- type Generator
- type IntervalTicker
- type MastodonClient
- type MastodonConfig
- type MastodonPrimesClient
- type Poster
- type PrimeBot
- type ProbablyPrimeGenerator
- type RandFetcher
- type Status
- type Ticker
- type TrialDivisionGenerator
- type TwitterClient
- type TwitterPrimesStatusService
- type TwitterPrimesTimelineService
- type WritePoster
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrCanceled is returned from a generator when its context is cancelled ErrCanceled = errors.New("cancelled") // ErrOverflow is returned from a generator when the generator number type's // max is overflowed ErrOverflow = errors.New("overflow") )
View Source
var (
MastodonStatusRex = regexp.MustCompile(`^<p>([0-9]+)</p>$`)
)
Functions ¶
This section is empty.
Types ¶
type CompositeGenerator ¶
type CompositeGenerator struct {
// contains filtered or unexported fields
}
func NewCompositeGenerator ¶
func NewCompositeGenerator(start *big.Int) *CompositeGenerator
func (*CompositeGenerator) SetStart ¶
func (c *CompositeGenerator) SetStart(start *big.Int)
type IntervalTicker ¶
type IntervalTicker struct {
// contains filtered or unexported fields
}
func NewIntervalTicker ¶
func NewIntervalTicker(d time.Duration) *IntervalTicker
func (IntervalTicker) Interval ¶
func (i IntervalTicker) Interval() time.Duration
type MastodonClient ¶
type MastodonClient struct {
// contains filtered or unexported fields
}
func NewMastodonClient ¶
func NewMastodonClient(ctx context.Context, config *MastodonConfig) (*MastodonClient, error)
type MastodonConfig ¶
type MastodonPrimesClient ¶
type PrimeBot ¶
type PrimeBot struct {
// contains filtered or unexported fields
}
func NewPrimeBot ¶
type ProbablyPrimeGenerator ¶
type ProbablyPrimeGenerator struct {
// contains filtered or unexported fields
}
ProbablyPrimeGenerator is a prime number generator that uses the math/big package's ProbablyPrime; it is 100% accurate up to the max value of a uint, at which point it overflows; this cannot be used to generate any prime number larger than 2**64
func NewProbablyPrimeGenerator ¶
func NewProbablyPrimeGenerator(start *big.Int) *ProbablyPrimeGenerator
NewProbablyPrimeGenerator creates a new ProbablyPrimeGenerator, starting at the given number
func (*ProbablyPrimeGenerator) Generate ¶
Generate generates the next prime number from the ProbablyPrime generator
func (*ProbablyPrimeGenerator) SetStart ¶
func (p *ProbablyPrimeGenerator) SetStart(start *big.Int)
type RandFetcher ¶
type RandFetcher struct {
// contains filtered or unexported fields
}
func NewRandFetcher ¶
func NewRandFetcher() *RandFetcher
type TrialDivisionGenerator ¶
type TrialDivisionGenerator struct {
// contains filtered or unexported fields
}
func NewTrialDivisionGenerator ¶
func NewTrialDivisionGenerator(start *big.Int) *TrialDivisionGenerator
func (*TrialDivisionGenerator) SetStart ¶
func (t *TrialDivisionGenerator) SetStart(start *big.Int)
type TwitterClient ¶
type TwitterClient struct {
// contains filtered or unexported fields
}
func NewTwitterClient ¶
func NewTwitterClient(c *http.Client) (*TwitterClient, error)
type WritePoster ¶
type WritePoster struct {
// contains filtered or unexported fields
}
func NewStdoutPoster ¶
func NewStdoutPoster() *WritePoster
func NewWriterPoster ¶
func NewWriterPoster(w io.Writer) *WritePoster
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
primebot-mastodon
command
|
|
|
primebot-stdout
command
|
|
|
primebot-twitter
command
|
Click to show internal directories.
Click to hide internal directories.