-
Notifications
You must be signed in to change notification settings - Fork 0
/
enum_eventtype.go
67 lines (52 loc) · 1.95 KB
/
enum_eventtype.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package flate
import (
"fmt"
"github.com/chronos-tachyon/enumhelper"
)
// EventType indicates the type of an Event.
type EventType byte
const (
// StreamBeginEvent indicates that the beginning of a compressed stream
// was detected.
StreamBeginEvent EventType = iota
// StreamHeaderEvent indicates that the stream header was successfully
// processed.
StreamHeaderEvent
// BlockBeginEvent indicates that a block was detected.
BlockBeginEvent
// BlockTreesEvent indicates that the Huffman tree metadata for the
// current block have been successfully processed.
BlockTreesEvent
// BlockEndEvent indicates that the data for the current block has been
// successfully processed.
BlockEndEvent
// StreamEndEvent indicates that the end of the current stream was
// detected.
StreamEndEvent
// StreamCloseEvent indicates that the stream footer was successfully
// processed.
StreamCloseEvent
)
var eventTypeData = []enumhelper.EnumData{
{GoName: "StreamBeginEvent", Name: "stream-begin"},
{GoName: "StreamHeaderEvent", Name: "stream-header"},
{GoName: "BlockBeginEvent", Name: "block-begin"},
{GoName: "BlockTreesEvent", Name: "block-trees"},
{GoName: "BlockEndEvent", Name: "block-end"},
{GoName: "StreamEndEvent", Name: "stream-end"},
{GoName: "StreamCloseEvent", Name: "stream-close"},
}
// GoString returns the Go string representation of this EventType constant.
func (e EventType) GoString() string {
return enumhelper.DereferenceEnumData("EventType", eventTypeData, uint(e)).GoName
}
// String returns the string representation of this EventType constant.
func (e EventType) String() string {
return enumhelper.DereferenceEnumData("EventType", eventTypeData, uint(e)).Name
}
// MarshalJSON returns the JSON representation of this EventType constant.
func (e EventType) MarshalJSON() ([]byte, error) {
return enumhelper.MarshalEnumToJSON("EventType", eventTypeData, uint(e))
}
var _ fmt.GoStringer = EventType(0)
var _ fmt.Stringer = EventType(0)