package browser
import (
"fmt"
"github.com/mailru/easyjson"
"github.com/mailru/easyjson/jlexer"
"github.com/mailru/easyjson/jwriter"
)
type WindowID int64
func (t WindowID ) Int64 () int64 {
return int64 (t )
}
type WindowState string
func (t WindowState ) String () string {
return string (t )
}
const (
WindowStateNormal WindowState = "normal"
WindowStateMinimized WindowState = "minimized"
WindowStateMaximized WindowState = "maximized"
WindowStateFullscreen WindowState = "fullscreen"
)
func (t WindowState ) MarshalEasyJSON (out *jwriter .Writer ) {
out .String (string (t ))
}
func (t WindowState ) MarshalJSON () ([]byte , error ) {
return easyjson .Marshal (t )
}
func (t *WindowState ) UnmarshalEasyJSON (in *jlexer .Lexer ) {
v := in .String ()
switch WindowState (v ) {
case WindowStateNormal :
*t = WindowStateNormal
case WindowStateMinimized :
*t = WindowStateMinimized
case WindowStateMaximized :
*t = WindowStateMaximized
case WindowStateFullscreen :
*t = WindowStateFullscreen
default :
in .AddError (fmt .Errorf ("unknown WindowState value: %v" , v ))
}
}
func (t *WindowState ) UnmarshalJSON (buf []byte ) error {
return easyjson .Unmarshal (buf , t )
}
type Bounds struct {
Left int64 `json:"left,omitempty"`
Top int64 `json:"top,omitempty"`
Width int64 `json:"width,omitempty"`
Height int64 `json:"height,omitempty"`
WindowState WindowState `json:"windowState,omitempty"`
}
type PermissionType string
func (t PermissionType ) String () string {
return string (t )
}
const (
PermissionTypeAccessibilityEvents PermissionType = "accessibilityEvents"
PermissionTypeAudioCapture PermissionType = "audioCapture"
PermissionTypeBackgroundSync PermissionType = "backgroundSync"
PermissionTypeBackgroundFetch PermissionType = "backgroundFetch"
PermissionTypeClipboardReadWrite PermissionType = "clipboardReadWrite"
PermissionTypeClipboardSanitizedWrite PermissionType = "clipboardSanitizedWrite"
PermissionTypeDisplayCapture PermissionType = "displayCapture"
PermissionTypeDurableStorage PermissionType = "durableStorage"
PermissionTypeFlash PermissionType = "flash"
PermissionTypeGeolocation PermissionType = "geolocation"
PermissionTypeIdleDetection PermissionType = "idleDetection"
PermissionTypeLocalFonts PermissionType = "localFonts"
PermissionTypeMidi PermissionType = "midi"
PermissionTypeMidiSysex PermissionType = "midiSysex"
PermissionTypeNfc PermissionType = "nfc"
PermissionTypeNotifications PermissionType = "notifications"
PermissionTypePaymentHandler PermissionType = "paymentHandler"
PermissionTypePeriodicBackgroundSync PermissionType = "periodicBackgroundSync"
PermissionTypeProtectedMediaIdentifier PermissionType = "protectedMediaIdentifier"
PermissionTypeSensors PermissionType = "sensors"
PermissionTypeStorageAccess PermissionType = "storageAccess"
PermissionTypeTopLevelStorageAccess PermissionType = "topLevelStorageAccess"
PermissionTypeVideoCapture PermissionType = "videoCapture"
PermissionTypeVideoCapturePanTiltZoom PermissionType = "videoCapturePanTiltZoom"
PermissionTypeWakeLockScreen PermissionType = "wakeLockScreen"
PermissionTypeWakeLockSystem PermissionType = "wakeLockSystem"
PermissionTypeWindowManagement PermissionType = "windowManagement"
)
func (t PermissionType ) MarshalEasyJSON (out *jwriter .Writer ) {
out .String (string (t ))
}
func (t PermissionType ) MarshalJSON () ([]byte , error ) {
return easyjson .Marshal (t )
}
func (t *PermissionType ) UnmarshalEasyJSON (in *jlexer .Lexer ) {
v := in .String ()
switch PermissionType (v ) {
case PermissionTypeAccessibilityEvents :
*t = PermissionTypeAccessibilityEvents
case PermissionTypeAudioCapture :
*t = PermissionTypeAudioCapture
case PermissionTypeBackgroundSync :
*t = PermissionTypeBackgroundSync
case PermissionTypeBackgroundFetch :
*t = PermissionTypeBackgroundFetch
case PermissionTypeClipboardReadWrite :
*t = PermissionTypeClipboardReadWrite
case PermissionTypeClipboardSanitizedWrite :
*t = PermissionTypeClipboardSanitizedWrite
case PermissionTypeDisplayCapture :
*t = PermissionTypeDisplayCapture
case PermissionTypeDurableStorage :
*t = PermissionTypeDurableStorage
case PermissionTypeFlash :
*t = PermissionTypeFlash
case PermissionTypeGeolocation :
*t = PermissionTypeGeolocation
case PermissionTypeIdleDetection :
*t = PermissionTypeIdleDetection
case PermissionTypeLocalFonts :
*t = PermissionTypeLocalFonts
case PermissionTypeMidi :
*t = PermissionTypeMidi
case PermissionTypeMidiSysex :
*t = PermissionTypeMidiSysex
case PermissionTypeNfc :
*t = PermissionTypeNfc
case PermissionTypeNotifications :
*t = PermissionTypeNotifications
case PermissionTypePaymentHandler :
*t = PermissionTypePaymentHandler
case PermissionTypePeriodicBackgroundSync :
*t = PermissionTypePeriodicBackgroundSync
case PermissionTypeProtectedMediaIdentifier :
*t = PermissionTypeProtectedMediaIdentifier
case PermissionTypeSensors :
*t = PermissionTypeSensors
case PermissionTypeStorageAccess :
*t = PermissionTypeStorageAccess
case PermissionTypeTopLevelStorageAccess :
*t = PermissionTypeTopLevelStorageAccess
case PermissionTypeVideoCapture :
*t = PermissionTypeVideoCapture
case PermissionTypeVideoCapturePanTiltZoom :
*t = PermissionTypeVideoCapturePanTiltZoom
case PermissionTypeWakeLockScreen :
*t = PermissionTypeWakeLockScreen
case PermissionTypeWakeLockSystem :
*t = PermissionTypeWakeLockSystem
case PermissionTypeWindowManagement :
*t = PermissionTypeWindowManagement
default :
in .AddError (fmt .Errorf ("unknown PermissionType value: %v" , v ))
}
}
func (t *PermissionType ) UnmarshalJSON (buf []byte ) error {
return easyjson .Unmarshal (buf , t )
}
type PermissionSetting string
func (t PermissionSetting ) String () string {
return string (t )
}
const (
PermissionSettingGranted PermissionSetting = "granted"
PermissionSettingDenied PermissionSetting = "denied"
PermissionSettingPrompt PermissionSetting = "prompt"
)
func (t PermissionSetting ) MarshalEasyJSON (out *jwriter .Writer ) {
out .String (string (t ))
}
func (t PermissionSetting ) MarshalJSON () ([]byte , error ) {
return easyjson .Marshal (t )
}
func (t *PermissionSetting ) UnmarshalEasyJSON (in *jlexer .Lexer ) {
v := in .String ()
switch PermissionSetting (v ) {
case PermissionSettingGranted :
*t = PermissionSettingGranted
case PermissionSettingDenied :
*t = PermissionSettingDenied
case PermissionSettingPrompt :
*t = PermissionSettingPrompt
default :
in .AddError (fmt .Errorf ("unknown PermissionSetting value: %v" , v ))
}
}
func (t *PermissionSetting ) UnmarshalJSON (buf []byte ) error {
return easyjson .Unmarshal (buf , t )
}
type PermissionDescriptor struct {
Name string `json:"name"`
Sysex bool `json:"sysex,omitempty"`
UserVisibleOnly bool `json:"userVisibleOnly,omitempty"`
AllowWithoutSanitization bool `json:"allowWithoutSanitization,omitempty"`
PanTiltZoom bool `json:"panTiltZoom,omitempty"`
}
type CommandID string
func (t CommandID ) String () string {
return string (t )
}
const (
CommandIDOpenTabSearch CommandID = "openTabSearch"
CommandIDCloseTabSearch CommandID = "closeTabSearch"
)
func (t CommandID ) MarshalEasyJSON (out *jwriter .Writer ) {
out .String (string (t ))
}
func (t CommandID ) MarshalJSON () ([]byte , error ) {
return easyjson .Marshal (t )
}
func (t *CommandID ) UnmarshalEasyJSON (in *jlexer .Lexer ) {
v := in .String ()
switch CommandID (v ) {
case CommandIDOpenTabSearch :
*t = CommandIDOpenTabSearch
case CommandIDCloseTabSearch :
*t = CommandIDCloseTabSearch
default :
in .AddError (fmt .Errorf ("unknown CommandID value: %v" , v ))
}
}
func (t *CommandID ) UnmarshalJSON (buf []byte ) error {
return easyjson .Unmarshal (buf , t )
}
type Bucket struct {
Low int64 `json:"low"`
High int64 `json:"high"`
Count int64 `json:"count"`
}
type Histogram struct {
Name string `json:"name"`
Sum int64 `json:"sum"`
Count int64 `json:"count"`
Buckets []*Bucket `json:"buckets"`
}
type DownloadProgressState string
func (t DownloadProgressState ) String () string {
return string (t )
}
const (
DownloadProgressStateInProgress DownloadProgressState = "inProgress"
DownloadProgressStateCompleted DownloadProgressState = "completed"
DownloadProgressStateCanceled DownloadProgressState = "canceled"
)
func (t DownloadProgressState ) MarshalEasyJSON (out *jwriter .Writer ) {
out .String (string (t ))
}
func (t DownloadProgressState ) MarshalJSON () ([]byte , error ) {
return easyjson .Marshal (t )
}
func (t *DownloadProgressState ) UnmarshalEasyJSON (in *jlexer .Lexer ) {
v := in .String ()
switch DownloadProgressState (v ) {
case DownloadProgressStateInProgress :
*t = DownloadProgressStateInProgress
case DownloadProgressStateCompleted :
*t = DownloadProgressStateCompleted
case DownloadProgressStateCanceled :
*t = DownloadProgressStateCanceled
default :
in .AddError (fmt .Errorf ("unknown DownloadProgressState value: %v" , v ))
}
}
func (t *DownloadProgressState ) UnmarshalJSON (buf []byte ) error {
return easyjson .Unmarshal (buf , t )
}
type SetDownloadBehaviorBehavior string
func (t SetDownloadBehaviorBehavior ) String () string {
return string (t )
}
const (
SetDownloadBehaviorBehaviorDeny SetDownloadBehaviorBehavior = "deny"
SetDownloadBehaviorBehaviorAllow SetDownloadBehaviorBehavior = "allow"
SetDownloadBehaviorBehaviorAllowAndName SetDownloadBehaviorBehavior = "allowAndName"
SetDownloadBehaviorBehaviorDefault SetDownloadBehaviorBehavior = "default"
)
func (t SetDownloadBehaviorBehavior ) MarshalEasyJSON (out *jwriter .Writer ) {
out .String (string (t ))
}
func (t SetDownloadBehaviorBehavior ) MarshalJSON () ([]byte , error ) {
return easyjson .Marshal (t )
}
func (t *SetDownloadBehaviorBehavior ) UnmarshalEasyJSON (in *jlexer .Lexer ) {
v := in .String ()
switch SetDownloadBehaviorBehavior (v ) {
case SetDownloadBehaviorBehaviorDeny :
*t = SetDownloadBehaviorBehaviorDeny
case SetDownloadBehaviorBehaviorAllow :
*t = SetDownloadBehaviorBehaviorAllow
case SetDownloadBehaviorBehaviorAllowAndName :
*t = SetDownloadBehaviorBehaviorAllowAndName
case SetDownloadBehaviorBehaviorDefault :
*t = SetDownloadBehaviorBehaviorDefault
default :
in .AddError (fmt .Errorf ("unknown SetDownloadBehaviorBehavior value: %v" , v ))
}
}
func (t *SetDownloadBehaviorBehavior ) UnmarshalJSON (buf []byte ) error {
return easyjson .Unmarshal (buf , t )
}
The pages are generated with Golds v0.8.2 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .