Documentation
¶
Index ¶
- type Ticket
- func (m *Ticket) Expire(age *time.Duration) *Ticket
- func (m *Ticket) Generate() string
- func (m *Ticket) Load(ticket *string, writer io.Writer) bool
- func (m *Ticket) Next(random bool) *string
- func (m *Ticket) Queue() *Ticket
- func (m *Ticket) Reader(ticket *string) (io.ReadCloser, bool)
- func (m *Ticket) Remove(ticket *string) bool
- func (m *Ticket) Save(ticket *string, reader io.Reader) (string, bool)
- func (m *Ticket) Start(ctx context.Context)
- func (m *Ticket) Writer(ticket *string) (io.WriteCloser, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ticket ¶
type Ticket struct {
Path string // default is /tmp
// contains filtered or unexported fields
}
Ticket
func (*Ticket) Expire ¶
Expire aged tickets in ticket.Path now; nil sets default 12hr when not already set or age sets ttl to timeframe specified
func (*Ticket) Generate ¶
Generate new ticket uuid; concurrency safe
random :0 e4e45937-79c9-c3b4-07e4-7c13d989f9235e15 sequence :1+ 00000001-5d9b-95d2-de8d-9c7cb21451fac9c1
[4]byte header, uint32 identifier [2]byte high 32bit unix time [2]byte low 32bit unix time [2]byte random uint16 [8]byte random uint64
func (*Ticket) Next ¶
Next returns the next ticket for processing from m.Path reading in directory order, not necessarily fifo; or random selection mixing
func (*Ticket) Reader ¶
func (m *Ticket) Reader(ticket *string) (io.ReadCloser, bool)
Reader opens the ticketed file and returns an io.ReadCloser
Click to show internal directories.
Click to hide internal directories.