forked from chromedp/chromedp
/
types.go
77 lines (66 loc) · 1.72 KB
/
types.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
68
69
70
71
72
73
74
75
76
77
package storage
import (
"errors"
"github.com/mailru/easyjson"
"github.com/mailru/easyjson/jlexer"
"github.com/mailru/easyjson/jwriter"
)
// AUTOGENERATED. DO NOT EDIT.
// Type enum of possible storage types.
type Type string
// String returns the Type as string value.
func (t Type) String() string {
return string(t)
}
// Type values.
const (
TypeAppcache Type = "appcache"
TypeCookies Type = "cookies"
TypeFileSystems Type = "file_systems"
TypeIndexeddb Type = "indexeddb"
TypeLocalStorage Type = "local_storage"
TypeShaderCache Type = "shader_cache"
TypeWebsql Type = "websql"
TypeServiceWorkers Type = "service_workers"
TypeCacheStorage Type = "cache_storage"
TypeAll Type = "all"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t Type) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t Type) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *Type) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch Type(in.String()) {
case TypeAppcache:
*t = TypeAppcache
case TypeCookies:
*t = TypeCookies
case TypeFileSystems:
*t = TypeFileSystems
case TypeIndexeddb:
*t = TypeIndexeddb
case TypeLocalStorage:
*t = TypeLocalStorage
case TypeShaderCache:
*t = TypeShaderCache
case TypeWebsql:
*t = TypeWebsql
case TypeServiceWorkers:
*t = TypeServiceWorkers
case TypeCacheStorage:
*t = TypeCacheStorage
case TypeAll:
*t = TypeAll
default:
in.AddError(errors.New("unknown Type value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *Type) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}