├── .dockerignore ├── .gitignore ├── Dockerfile ├── Gopkg.lock ├── Gopkg.toml ├── LICENSE ├── Makefile ├── README.md ├── debian ├── compat ├── control ├── copyright ├── gbp.conf ├── local │ ├── insserv.conf.d │ │ └── octoscreen │ └── octoscreen │ │ ├── config │ │ └── disablescreenblank.sh ├── octoscreen.config ├── octoscreen.install ├── octoscreen.postinst ├── octoscreen.service ├── octoscreen.templates ├── rules ├── source │ └── format └── watch ├── docs ├── ButtonImages.html ├── DefaultConfig.md ├── README.md └── img │ ├── bed-level.png │ ├── control.png │ ├── fan.png │ ├── filament.png │ ├── home.png │ ├── move.png │ ├── network.png │ ├── system.png │ ├── temperature-presets.png │ ├── temperature.png │ ├── tool-changer.png │ └── z-offset-calibration.png ├── index.html ├── interfaces ├── IPanel.go └── ITemperatureDataDisplay.go ├── logger ├── contextHook.go └── logger.go ├── main.go ├── octoprintApis ├── BedOffsetRequest.go ├── BedStateRequest.go ├── BedTargetRequest.go ├── CancelRequest.go ├── CommandRequest.go ├── ConnectRequest.go ├── ConnectionRequest.go ├── CustomCommandsRequest.go ├── DeleteFileRequest.go ├── DisconnectRequest.go ├── FakesAckRequest.go ├── FileRequest.go ├── FilesRequest.go ├── FullStateRequest.go ├── JobRequest.go ├── LICENSE ├── NotificationRequest.go ├── OctoScreenSettingsRequest.go ├── PauseRequest.go ├── PluginManagerInfoRequest.go ├── PrintHeadHomeRequest.go ├── PrintHeadJogRequest.go ├── PrinterProfilesRequest.go ├── README.md ├── RestartRequest.go ├── RunZOffsetCalibrationRequest.go ├── SdInitRequest.go ├── SdRefreshRequest.go ├── SdReleaseRequest.go ├── SdStateRequest.go ├── SelectFileRequest.go ├── StartRequest.go ├── StatusMapping.go ├── SystemExecuteCommandRequest.go ├── TemperatureDataRequest.go ├── ToolExtrudeRequest.go ├── ToolFlowRateRequest.go ├── ToolOffsetRequest.go ├── ToolSelectRequest.go ├── ToolStateRequest.go ├── ToolTargetRequest.go ├── UploadFileRequest.go ├── ZOffsetRequest.go ├── _examples │ └── state │ │ └── main.go ├── client.go ├── common.go ├── common_test.go ├── connection.go ├── dataModels │ ├── ApiConfig.go │ ├── Axis.go │ ├── CommandDefinition.go │ ├── CommandSource.go │ ├── ConnectionResponse.go │ ├── ConnectionState.go │ ├── ControlContainer.go │ ├── ControlDefinition.go │ ├── ControlInput.go │ ├── CustomCommandsResponse.go │ ├── FeaturesConfig.go │ ├── Filament.go │ ├── FileResponse.go │ ├── FilesResponse.go │ ├── FolderConfig.go │ ├── FullStateResponse.go │ ├── GCodeAnalysisInformation.go │ ├── HistoricTemperatureData.go │ ├── JobInformation.go │ ├── JobResponse.go │ ├── JsonTime.go │ ├── Location.go │ ├── MenuItem.go │ ├── NotificationResponse.go │ ├── OctoScreenSettingsResponse.go │ ├── PauseAction.go │ ├── Plugin.go │ ├── PluginManagerInfoResponse.go │ ├── PrintStats.go │ ├── PrinterProfileResponse.go │ ├── PrinterProfilesResponse.go │ ├── PrinterState.go │ ├── Profile.go │ ├── ProgressInformation.go │ ├── Reference.go │ ├── SdState.go │ ├── SerialConfig.go │ ├── ServerConfig.go │ ├── SettingsResponse.go │ ├── SystemCommandsResponse.go │ ├── TemperatureConfig.go │ ├── TemperatureData.go │ ├── TemperatureDataResponse.go │ ├── TemperaturePreset.go │ ├── TemperatureStateResponse.go │ ├── TerminalFilter.go │ ├── UploadFileResponse.go │ ├── VersionResponse.go │ ├── WebcamConfig.go │ └── ZOffsetResponse.go ├── files.go ├── job.go ├── printer.go ├── settings.go ├── system.go ├── system_test.go ├── version.go └── zbolt.go ├── styles └── z-bolt │ ├── images │ ├── actions.svg │ ├── back.svg │ ├── backspace.svg │ ├── bed-level-parts │ │ ├── bed-corner-b-l.svg │ │ ├── bed-corner-b-r.svg │ │ ├── bed-corner-t-l.svg │ │ └── bed-corner-t-r.svg │ ├── bed-level.svg │ ├── bed.svg │ ├── blank.svg │ ├── complete.svg │ ├── control.svg │ ├── cool-down.svg │ ├── custom-script.svg │ ├── decrease.svg │ ├── extruder-extrude.svg │ ├── extruder-multi.svg │ ├── extruder-retract.svg │ ├── extruder-typeB-1.svg │ ├── extruder-typeB-2.svg │ ├── extruder-typeB-3.svg │ ├── extruder-typeB-4.svg │ ├── extruder-typeB.svg │ ├── extruder.svg │ ├── fan-off.svg │ ├── fan-on.svg │ ├── fan.svg │ ├── filament-spool-load.svg │ ├── filament-spool-unload.svg │ ├── filament-spool.svg │ ├── file-gcode.svg │ ├── file-stl.svg │ ├── files.svg │ ├── folder.svg │ ├── heat-up.svg │ ├── home-x.svg │ ├── home-y.svg │ ├── home-z.svg │ ├── home.svg │ ├── hotend-1.svg │ ├── hotend-2.svg │ ├── hotend-3.svg │ ├── hotend-4.svg │ ├── hotend-multi.svg │ ├── hotend.svg │ ├── increase.svg │ ├── info.svg │ ├── logos │ │ ├── logo-octoprint.png │ │ ├── logo.png │ │ ├── octoscreen-isometric-90%.png │ │ ├── octoscreen-isometric.png │ │ └── puzzle-piece.png │ ├── magnet-off.svg │ ├── magnet-on.svg │ ├── motor-off.svg │ ├── motor-on.svg │ ├── move-step.svg │ ├── move-x+.svg │ ├── move-x-.svg │ ├── move-y+.svg │ ├── move-y-.svg │ ├── move-z+.svg │ ├── move-z-.svg │ ├── move.svg │ ├── network.svg │ ├── nozzle-1.svg │ ├── nozzle-2.svg │ ├── nozzle-3.svg │ ├── nozzle-4.svg │ ├── nozzle.svg │ ├── octoprint-tentacle.svg │ ├── open.svg │ ├── pause.svg │ ├── print.svg │ ├── printing-control.svg │ ├── reboot.svg │ ├── refresh.svg │ ├── restart.svg │ ├── resume.svg │ ├── retract.svg │ ├── sd-eject.svg │ ├── sd.svg │ ├── settings.svg │ ├── shutdown.svg │ ├── speed-0%.svg │ ├── speed-100%.svg │ ├── speed-17%.svg │ ├── speed-34%.svg │ ├── speed-50%.svg │ ├── speed-67%.svg │ ├── speed-83%.svg │ ├── speed-fast.svg │ ├── speed-normal.svg │ ├── speed-slow.svg │ ├── status.svg │ ├── stop.svg │ ├── time.svg │ ├── tool-changer.svg │ ├── toolhead-typeA-1.svg │ ├── toolhead-typeA-2.svg │ ├── toolhead-typeA-3.svg │ ├── toolhead-typeA-4.svg │ ├── toolhead-typeA.svg │ ├── toolhead-typeB-1.svg │ ├── toolhead-typeB-2.svg │ ├── toolhead-typeB-3.svg │ ├── toolhead-typeB-4.svg │ ├── toolhead-typeB.svg │ ├── z-calibration.svg │ ├── z-offset-decrease.svg │ └── z-offset-increase.svg │ └── style.css ├── ui ├── BedLevelPanel.go ├── CommonPanel.go ├── ConfigurationPanel.go ├── ConnectionPanel.go ├── ControlPanel.go ├── CustomItemsPanel.go ├── FanPanel.go ├── FatalErrorWindow.go ├── FilamentPanel.go ├── FilesPanel.go ├── HomePanel.go ├── HttpRequestTestWindow.go ├── IdleStatusPanel.go ├── MovePanel.go ├── NetworkPanel.go ├── PrintMenuPanel.go ├── PrintStatusPanel.go ├── SplashPanel.go ├── SystemPanel.go ├── TemperaturePanel.go ├── TemperaturePresetsPanel.go ├── menu.go ├── tool_changer_panel.go ├── ui.go └── z_offset_calibration_panel.go ├── uiWidgets ├── AmountToExtrudeStepButton.go ├── AmountToMoveStepButton.go ├── CommandButton.go ├── ControlButton.go ├── CoolDownButton.go ├── FanButton.go ├── FilamentExtrudeButton.go ├── FilamentLoadButton.go ├── FlowRateStepButton.go ├── HomeAllButton.go ├── HomeButton.go ├── IncreaseZOffsetButton.go ├── ManualZCalibrationStepButton.go ├── MoveButton.go ├── MustPressedButton.go ├── NotificatinsBox.go ├── NotificationsHook.go ├── OctoPrintInfoBox.go ├── OctoScreenInfoBox.go ├── OctoScreenPluginInfoBox.go ├── SelectToolStepButton.go ├── StepButton.go ├── SystemCommandButton.go ├── SystemInfoBox.go ├── SystemInformationInfoBox.go ├── TemperatureAmountStepButton.go ├── TemperatureIncreaseButton.go ├── TemperaturePresetButton.go ├── TemperatureStatusBox.go ├── ToolButton.go └── ToolPrintingButon.go ├── utils ├── BackgroundTask.go ├── FileResponsesSortedByDate.go ├── FileResponsesSortedByName.go ├── LocationHistory.go ├── UpdateTemperaturesBackgroundTask.go ├── environment.go ├── filament.go ├── file_utils.go ├── globalVars.go ├── gtk.go ├── math_utils.go ├── string_utils.go ├── tools.go └── ui_utils.go └── vendor ├── github.com ├── StackExchange │ └── wmi │ │ ├── LICENSE │ │ ├── README.md │ │ ├── swbemservices.go │ │ ├── swbemservices_test.go │ │ ├── wmi.go │ │ └── wmi_test.go ├── coreos │ └── go-systemd │ │ ├── .travis.yml │ │ ├── CONTRIBUTING.md │ │ ├── DCO │ │ ├── Gopkg.toml │ │ ├── Jenkinsfile │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── activation │ │ ├── common_test.go │ │ ├── files.go │ │ ├── files_test.go │ │ ├── listeners.go │ │ ├── listeners_test.go │ │ ├── packetconns.go │ │ └── packetconns_test.go │ │ ├── code-of-conduct.md │ │ ├── daemon │ │ ├── sdnotify.go │ │ ├── sdnotify_test.go │ │ ├── watchdog.go │ │ └── watchdog_test.go │ │ ├── dbus │ │ ├── dbus.go │ │ ├── dbus_test.go │ │ ├── methods.go │ │ ├── methods_test.go │ │ ├── properties.go │ │ ├── set.go │ │ ├── set_test.go │ │ ├── subscription.go │ │ ├── subscription_set.go │ │ ├── subscription_set_test.go │ │ └── subscription_test.go │ │ ├── examples │ │ └── activation │ │ │ ├── activation.go │ │ │ ├── httpserver │ │ │ ├── README.md │ │ │ ├── hello.service │ │ │ ├── hello.socket │ │ │ └── httpserver.go │ │ │ ├── listen.go │ │ │ └── udpconn.go │ │ ├── fixtures │ │ ├── enable-disable.service │ │ ├── image.raw.xz │ │ ├── image.tar.xz │ │ ├── mask-unmask.service │ │ ├── reload.service │ │ ├── start-failed.service │ │ ├── start-stop.service │ │ ├── subscribe-events-set.service │ │ └── subscribe-events.service │ │ ├── import1 │ │ ├── dbus.go │ │ └── dbus_test.go │ │ ├── journal │ │ ├── journal.go │ │ └── journal_test.go │ │ ├── login1 │ │ ├── dbus.go │ │ └── dbus_test.go │ │ ├── machine1 │ │ ├── dbus.go │ │ └── dbus_test.go │ │ ├── scripts │ │ ├── jenkins │ │ │ └── periodic-go-systemd-builder.sh │ │ └── travis │ │ │ └── pr-test.sh │ │ ├── sdjournal │ │ ├── functions.go │ │ ├── functions_test.go │ │ ├── journal.go │ │ ├── journal_test.go │ │ └── read.go │ │ ├── test │ │ ├── unit │ │ ├── deserialize.go │ │ ├── deserialize_test.go │ │ ├── end_to_end_test.go │ │ ├── escape.go │ │ ├── escape_test.go │ │ ├── option.go │ │ ├── option_test.go │ │ ├── serialize.go │ │ └── serialize_test.go │ │ └── util │ │ ├── util.go │ │ ├── util_cgo.go │ │ ├── util_stub.go │ │ └── util_test.go ├── dustin │ └── go-humanize │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.markdown │ │ ├── big.go │ │ ├── bigbytes.go │ │ ├── bigbytes_test.go │ │ ├── bytes.go │ │ ├── bytes_test.go │ │ ├── comma.go │ │ ├── comma_test.go │ │ ├── commaf.go │ │ ├── commaf_test.go │ │ ├── common_test.go │ │ ├── english │ │ ├── words.go │ │ └── words_test.go │ │ ├── ftoa.go │ │ ├── ftoa_test.go │ │ ├── humanize.go │ │ ├── number.go │ │ ├── number_test.go │ │ ├── ordinals.go │ │ ├── ordinals_test.go │ │ ├── si.go │ │ ├── si_test.go │ │ ├── times.go │ │ └── times_test.go ├── go-ole │ └── go-ole │ │ ├── .travis.yml │ │ ├── ChangeLog.md │ │ ├── README.md │ │ ├── _example │ │ ├── excel │ │ │ └── excel.go │ │ ├── excel2 │ │ │ └── excel.go │ │ ├── ie │ │ │ └── ie.go │ │ ├── itunes │ │ │ └── itunes.go │ │ ├── libreoffice │ │ │ └── libreoffice.go │ │ ├── mediaplayer │ │ │ └── mediaplayer.go │ │ ├── msagent │ │ │ └── msagent.go │ │ ├── msxml │ │ │ └── rssreader.go │ │ ├── outlook │ │ │ └── outlook.go │ │ └── winsock │ │ │ └── winsock.go │ │ ├── appveyor.yml │ │ ├── com.go │ │ ├── com_func.go │ │ ├── com_func_test.go │ │ ├── com_test.go │ │ ├── connect.go │ │ ├── connect_test.go │ │ ├── connect_windows_test.go │ │ ├── constants.go │ │ ├── data │ │ └── screenshot.png │ │ ├── error.go │ │ ├── error_func.go │ │ ├── error_windows.go │ │ ├── example │ │ ├── excel │ │ │ └── excel.go │ │ ├── excel2 │ │ │ └── excel.go │ │ ├── ie │ │ │ └── ie.go │ │ ├── itunes │ │ │ └── itunes.go │ │ ├── mediaplayer │ │ │ └── mediaplayer.go │ │ ├── msagent │ │ │ └── msagent.go │ │ ├── msxml │ │ │ └── rssreader.go │ │ ├── outlook │ │ │ └── outlook.go │ │ └── winsock │ │ │ └── winsock.go │ │ ├── guid.go │ │ ├── iconnectionpoint.go │ │ ├── iconnectionpoint_func.go │ │ ├── iconnectionpoint_windows.go │ │ ├── iconnectionpointcontainer.go │ │ ├── iconnectionpointcontainer_func.go │ │ ├── iconnectionpointcontainer_windows.go │ │ ├── idispatch.go │ │ ├── idispatch_func.go │ │ ├── idispatch_windows.go │ │ ├── idispatch_windows_test.go │ │ ├── ienumvariant.go │ │ ├── ienumvariant_func.go │ │ ├── ienumvariant_test.go │ │ ├── ienumvariant_windows.go │ │ ├── iinspectable.go │ │ ├── iinspectable_func.go │ │ ├── iinspectable_windows.go │ │ ├── iprovideclassinfo.go │ │ ├── iprovideclassinfo_func.go │ │ ├── iprovideclassinfo_windows.go │ │ ├── itypeinfo.go │ │ ├── itypeinfo_func.go │ │ ├── itypeinfo_windows.go │ │ ├── iunknown.go │ │ ├── iunknown_func.go │ │ ├── iunknown_windows.go │ │ ├── iunknown_windows_test.go │ │ ├── ole.go │ │ ├── oleutil │ │ ├── connection.go │ │ ├── connection_func.go │ │ ├── connection_windows.go │ │ ├── go-get.go │ │ └── oleutil.go │ │ ├── safearray.go │ │ ├── safearray_func.go │ │ ├── safearray_test.go │ │ ├── safearray_windows.go │ │ ├── safearrayconversion.go │ │ ├── safearrayconversion_test.go │ │ ├── safearrayslices.go │ │ ├── utility.go │ │ ├── variables.go │ │ ├── variant.go │ │ ├── variant_386.go │ │ ├── variant_amd64.go │ │ ├── vt_string.go │ │ ├── winrt.go │ │ └── winrt_doc.go ├── golang-collections │ └── collections │ │ ├── LICENSE │ │ ├── Readme.md │ │ ├── collections.go │ │ ├── grid │ │ └── grid.go │ │ ├── point.go │ │ ├── queue │ │ ├── queue.go │ │ └── queue_test.go │ │ ├── set │ │ ├── set.go │ │ └── set_test.go │ │ ├── skip │ │ ├── skip.go │ │ └── skip_test.go │ │ ├── splay │ │ ├── splay.go │ │ └── splay_test.go │ │ ├── stack │ │ ├── stack.go │ │ └── stack_test.go │ │ ├── trie │ │ ├── trie.go │ │ └── trie_test.go │ │ └── tst │ │ ├── tst.go │ │ └── tst_test.go ├── gotk3 │ └── gotk3 │ │ ├── .travis.yml │ │ ├── CHANGES │ │ ├── CONTRIBUTIONS.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cairo │ │ ├── antialias.go │ │ ├── cairo.go │ │ ├── canvas.go │ │ ├── errors.go │ │ ├── fillrule.go │ │ ├── format.go │ │ ├── linecap.go │ │ ├── linejoin.go │ │ ├── mimetype.go │ │ ├── operator.go │ │ ├── pattern.go │ │ ├── status.go │ │ ├── surface.go │ │ ├── surfacetype.go │ │ ├── text.go │ │ ├── translations.go │ │ └── util.go │ │ ├── gdk │ │ ├── gdk.go │ │ ├── gdk.go.h │ │ ├── gdk_3_6-8.go │ │ ├── gdk_deprecated_since_3_16.go │ │ ├── gdk_deprecated_since_3_20.go │ │ ├── gdk_deprecated_since_3_22.go │ │ ├── gdk_pixbuf_format.go │ │ ├── keys.go │ │ ├── screen.go │ │ ├── screen_no_x11.go │ │ ├── screen_x11.go │ │ ├── window_no_x11.go │ │ └── window_x11.go │ │ ├── glib │ │ ├── application.go │ │ ├── connect.go │ │ ├── gbinding.go │ │ ├── glib.go │ │ ├── glib.go.h │ │ ├── glib_extension.go │ │ ├── glib_test.go │ │ ├── gmain_context.go │ │ ├── gsource.go │ │ ├── gvariant.go │ │ ├── gvariant.go.h │ │ ├── gvariant_test.go │ │ ├── gvariantbuilder.go │ │ ├── gvariantclass.go │ │ ├── gvariantdict.go │ │ ├── gvariantiter.go │ │ ├── gvarianttype.go │ │ ├── gvarianttype.go.h │ │ ├── list.go │ │ ├── list_test.go │ │ ├── menu.go │ │ ├── notifications.go │ │ ├── settings.go │ │ ├── settings_backend.go │ │ ├── settings_schema.go │ │ ├── settings_schema_source.go │ │ └── slist.go │ │ ├── gtk │ │ ├── aboutdialog.go │ │ ├── accel.go │ │ ├── accel_test.go │ │ ├── actionbar_since_3_12.go │ │ ├── actionbar_since_3_12.go.h │ │ ├── app_chooser.go │ │ ├── application.go │ │ ├── application_since_3_12.go │ │ ├── application_since_3_14.go │ │ ├── application_window.go │ │ ├── color_chooser.go │ │ ├── combo_box.go │ │ ├── gtk.go │ │ ├── gtk.go.h │ │ ├── gtk_deprecated_since_3_10.go │ │ ├── gtk_deprecated_since_3_12.go │ │ ├── gtk_deprecated_since_3_14.go │ │ ├── gtk_deprecated_since_3_14.go.h │ │ ├── gtk_deprecated_since_3_16.go │ │ ├── gtk_deprecated_since_3_20.go │ │ ├── gtk_deprecated_since_3_22.go │ │ ├── gtk_export.go │ │ ├── gtk_since_3_10.go │ │ ├── gtk_since_3_10.go.h │ │ ├── gtk_since_3_12.go │ │ ├── gtk_since_3_12.go.h │ │ ├── gtk_since_3_16.go │ │ ├── gtk_since_3_16.go.h │ │ ├── gtk_since_3_18.go │ │ ├── gtk_since_3_8.go │ │ ├── gtk_test.go │ │ ├── info_bar.go │ │ ├── label.go │ │ ├── level_bar.go │ │ ├── level_bar_since_3_8.go │ │ ├── menu_before_3_22.go │ │ ├── menu_shell.go │ │ ├── menu_since_3_22.go │ │ ├── popover_since_3_12.go │ │ ├── popover_since_3_12.go.h │ │ ├── popover_since_3_18.go │ │ ├── print.go │ │ ├── print_since_3_16.go │ │ ├── print_test.go │ │ ├── settings.go │ │ ├── settings.go.h │ │ ├── stack_since_3_12.go │ │ ├── stackswitcher_since_3_10.go │ │ ├── style.go │ │ ├── text_iter.go │ │ ├── text_mark.go │ │ ├── text_view.go │ │ ├── tree_view.go │ │ ├── tree_view_column.go │ │ ├── version.go │ │ ├── version_test.go │ │ ├── widget.go │ │ ├── widget_since_3_12.go │ │ ├── widget_since_3_14.go │ │ ├── widget_since_3_8.go │ │ ├── window.go │ │ ├── window_since_3_10.go │ │ └── window_since_3_12.go │ │ ├── pango │ │ ├── pango-attributes.go │ │ ├── pango-attributes.go.h │ │ ├── pango-context.go │ │ ├── pango-font.go │ │ ├── pango-glyph-item.go │ │ ├── pango-glyph.go │ │ ├── pango-gravity.go │ │ ├── pango-layout.go │ │ ├── pango-layout.go.h │ │ ├── pango-types.go │ │ ├── pango.go │ │ ├── pango.go.h │ │ ├── pangocairo.go │ │ └── pangocairo.go.h │ │ └── shippable.yml ├── konsorten │ └── go-windows-terminal-sequences │ │ ├── LICENSE │ │ ├── README.md │ │ ├── go.mod │ │ ├── sequences.go │ │ ├── sequences_dummy.go │ │ └── sequences_test.go ├── mcuadros │ └── go-octoprint │ │ ├── .travis.yml │ │ ├── .travis │ │ └── config.yaml │ │ ├── FileRequest.go │ │ ├── FullStateRequest.go │ │ ├── JobInformation.go │ │ ├── JobRequest.go │ │ ├── LICENSE │ │ ├── ProgressInformation.go │ │ ├── README.md │ │ ├── SelectFileRequest.go │ │ ├── TemperatureData.go │ │ ├── TemperatureStateResponse.go │ │ ├── _examples │ │ └── state │ │ │ └── main.go │ │ ├── client.go │ │ ├── common.go │ │ ├── common_test.go │ │ ├── connection.go │ │ ├── files.go │ │ ├── files_test.go │ │ ├── job.go │ │ ├── plugin_manager.go │ │ ├── printer.go │ │ ├── printer_test.go │ │ ├── printerprofiles.go │ │ ├── settings.go │ │ ├── settings_test.go │ │ ├── system.go │ │ ├── system_test.go │ │ ├── version.go │ │ └── zbolt.go ├── shirou │ └── gopsutil │ │ ├── .circleci │ │ └── config.yml │ │ ├── .github │ │ └── ISSUE_TEMPLATE │ │ │ ├── bug_report.md │ │ │ └── feature_request.md │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.rst │ │ ├── circle.yml │ │ ├── coverall.sh │ │ ├── cpu │ │ ├── cpu.go │ │ ├── cpu_darwin.go │ │ ├── cpu_darwin_cgo.go │ │ ├── cpu_darwin_nocgo.go │ │ ├── cpu_fallback.go │ │ ├── cpu_freebsd.go │ │ ├── cpu_freebsd_386.go │ │ ├── cpu_freebsd_amd64.go │ │ ├── cpu_freebsd_test.go │ │ ├── cpu_linux.go │ │ ├── cpu_linux_test.go │ │ ├── cpu_openbsd.go │ │ ├── cpu_solaris.go │ │ ├── cpu_solaris_test.go │ │ ├── cpu_test.go │ │ ├── cpu_windows.go │ │ └── testdata │ │ │ ├── freebsd │ │ │ ├── 1cpu_2core.txt │ │ │ ├── 1cpu_4core.txt │ │ │ └── 2cpu_4core.txt │ │ │ ├── linux │ │ │ ├── 424 │ │ │ │ └── proc │ │ │ │ │ └── stat │ │ │ └── times_empty │ │ │ │ └── proc │ │ │ │ └── stat │ │ │ └── solaris │ │ │ ├── 1cpu_1core_isainfo.txt │ │ │ ├── 1cpu_1core_psrinfo.txt │ │ │ ├── 2cpu_1core_isainfo.txt │ │ │ ├── 2cpu_1core_psrinfo.txt │ │ │ ├── 2cpu_8core_isainfo.txt │ │ │ └── 2cpu_8core_psrinfo.txt │ │ ├── disk │ │ ├── disk.go │ │ ├── disk_darwin.go │ │ ├── disk_darwin.h │ │ ├── disk_darwin_amd64.go │ │ ├── disk_darwin_arm64.go │ │ ├── disk_darwin_cgo.go │ │ ├── disk_darwin_nocgo.go │ │ ├── disk_fallback.go │ │ ├── disk_freebsd.go │ │ ├── disk_freebsd_386.go │ │ ├── disk_freebsd_amd64.go │ │ ├── disk_linux.go │ │ ├── disk_openbsd.go │ │ ├── disk_openbsd_amd64.go │ │ ├── disk_test.go │ │ ├── disk_unix.go │ │ ├── disk_windows.go │ │ ├── types_freebsd.go │ │ └── types_openbsd.go │ │ ├── doc.go │ │ ├── docker │ │ ├── docker.go │ │ ├── docker_linux.go │ │ ├── docker_linux_test.go │ │ └── docker_notlinux.go │ │ ├── host │ │ ├── host.go │ │ ├── host_darwin.go │ │ ├── host_darwin_386.go │ │ ├── host_darwin_amd64.go │ │ ├── host_darwin_cgo.go │ │ ├── host_darwin_nocgo.go │ │ ├── host_fallback.go │ │ ├── host_freebsd.go │ │ ├── host_freebsd_386.go │ │ ├── host_freebsd_amd64.go │ │ ├── host_freebsd_arm.go │ │ ├── host_linux.go │ │ ├── host_linux_386.go │ │ ├── host_linux_amd64.go │ │ ├── host_linux_arm.go │ │ ├── host_linux_arm64.go │ │ ├── host_linux_mips.go │ │ ├── host_linux_mipsle.go │ │ ├── host_linux_ppc64le.go │ │ ├── host_linux_s390x.go │ │ ├── host_linux_test.go │ │ ├── host_openbsd.go │ │ ├── host_openbsd_amd64.go │ │ ├── host_solaris.go │ │ ├── host_test.go │ │ ├── host_windows.go │ │ ├── include │ │ │ ├── smc.c │ │ │ └── smc.h │ │ ├── types_darwin.go │ │ ├── types_freebsd.go │ │ ├── types_linux.go │ │ └── types_openbsd.go │ │ ├── internal │ │ └── common │ │ │ ├── binary.go │ │ │ ├── common.go │ │ │ ├── common_darwin.go │ │ │ ├── common_freebsd.go │ │ │ ├── common_linux.go │ │ │ ├── common_openbsd.go │ │ │ ├── common_test.go │ │ │ ├── common_unix.go │ │ │ └── common_windows.go │ │ ├── load │ │ ├── load.go │ │ ├── load_bsd.go │ │ ├── load_darwin.go │ │ ├── load_fallback.go │ │ ├── load_linux.go │ │ ├── load_test.go │ │ └── load_windows.go │ │ ├── mem │ │ ├── mem.go │ │ ├── mem_darwin.go │ │ ├── mem_darwin_cgo.go │ │ ├── mem_darwin_nocgo.go │ │ ├── mem_darwin_test.go │ │ ├── mem_fallback.go │ │ ├── mem_freebsd.go │ │ ├── mem_linux.go │ │ ├── mem_openbsd.go │ │ ├── mem_openbsd_amd64.go │ │ ├── mem_solaris.go │ │ ├── mem_test.go │ │ ├── mem_windows.go │ │ └── types_openbsd.go │ │ ├── mktypes.sh │ │ ├── net │ │ ├── net.go │ │ ├── net_darwin.go │ │ ├── net_darwin_test.go │ │ ├── net_fallback.go │ │ ├── net_freebsd.go │ │ ├── net_linux.go │ │ ├── net_linux_test.go │ │ ├── net_openbsd.go │ │ ├── net_test.go │ │ ├── net_unix.go │ │ └── net_windows.go │ │ ├── process │ │ ├── process.go │ │ ├── process_darwin.go │ │ ├── process_darwin_386.go │ │ ├── process_darwin_amd64.go │ │ ├── process_fallback.go │ │ ├── process_freebsd.go │ │ ├── process_freebsd_386.go │ │ ├── process_freebsd_amd64.go │ │ ├── process_freebsd_arm.go │ │ ├── process_linux.go │ │ ├── process_openbsd.go │ │ ├── process_openbsd_amd64.go │ │ ├── process_posix.go │ │ ├── process_posix_test.go │ │ ├── process_test.go │ │ ├── process_windows.go │ │ ├── process_windows_386.go │ │ ├── process_windows_amd64.go │ │ ├── testdata │ │ │ └── darwin │ │ │ │ └── ps-ax-opid_fail │ │ ├── types_darwin.go │ │ ├── types_freebsd.go │ │ └── types_openbsd.go │ │ ├── v2migration.sh │ │ ├── windows_memo.rst │ │ └── winservices │ │ ├── manager.go │ │ └── winservices.go └── sirupsen │ └── logrus │ ├── .gitignore │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── alt_exit.go │ ├── alt_exit_test.go │ ├── appveyor.yml │ ├── doc.go │ ├── entry.go │ ├── entry_test.go │ ├── example_basic_test.go │ ├── example_hook_test.go │ ├── exported.go │ ├── formatter.go │ ├── formatter_bench_test.go │ ├── hook_test.go │ ├── hooks.go │ ├── hooks │ ├── syslog │ │ ├── README.md │ │ ├── syslog.go │ │ └── syslog_test.go │ └── test │ │ ├── test.go │ │ └── test_test.go │ ├── internal │ └── testutils │ │ └── testutils.go │ ├── json_formatter.go │ ├── json_formatter_test.go │ ├── logger.go │ ├── logger_bench_test.go │ ├── logrus.go │ ├── logrus_test.go │ ├── terminal_bsd.go │ ├── terminal_check_appengine.go │ ├── terminal_check_notappengine.go │ ├── terminal_linux.go │ ├── text_formatter.go │ ├── text_formatter_test.go │ ├── travis │ ├── cross_build.sh │ └── install.sh │ └── writer.go ├── golang.org └── x │ ├── crypto │ ├── .gitattributes │ ├── .gitignore │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── README.md │ ├── acme │ │ ├── acme.go │ │ ├── acme_test.go │ │ ├── autocert │ │ │ ├── autocert.go │ │ │ ├── autocert_test.go │ │ │ ├── cache.go │ │ │ ├── cache_test.go │ │ │ ├── example_test.go │ │ │ ├── listener.go │ │ │ ├── renewal.go │ │ │ └── renewal_test.go │ │ ├── jws.go │ │ ├── jws_test.go │ │ ├── types.go │ │ └── types_test.go │ ├── argon2 │ │ ├── argon2.go │ │ ├── argon2_test.go │ │ ├── blake2b.go │ │ ├── blamka_amd64.go │ │ ├── blamka_amd64.s │ │ ├── blamka_generic.go │ │ └── blamka_ref.go │ ├── bcrypt │ │ ├── base64.go │ │ ├── bcrypt.go │ │ └── bcrypt_test.go │ ├── blake2b │ │ ├── blake2b.go │ │ ├── blake2bAVX2_amd64.go │ │ ├── blake2bAVX2_amd64.s │ │ ├── blake2b_amd64.go │ │ ├── blake2b_amd64.s │ │ ├── blake2b_generic.go │ │ ├── blake2b_ref.go │ │ ├── blake2b_test.go │ │ ├── blake2x.go │ │ └── register.go │ ├── blake2s │ │ ├── blake2s.go │ │ ├── blake2s_386.go │ │ ├── blake2s_386.s │ │ ├── blake2s_amd64.go │ │ ├── blake2s_amd64.s │ │ ├── blake2s_generic.go │ │ ├── blake2s_ref.go │ │ ├── blake2s_test.go │ │ ├── blake2x.go │ │ └── register.go │ ├── blowfish │ │ ├── block.go │ │ ├── blowfish_test.go │ │ ├── cipher.go │ │ └── const.go │ ├── bn256 │ │ ├── bn256.go │ │ ├── bn256_test.go │ │ ├── constants.go │ │ ├── curve.go │ │ ├── example_test.go │ │ ├── gfp12.go │ │ ├── gfp2.go │ │ ├── gfp6.go │ │ ├── optate.go │ │ └── twist.go │ ├── cast5 │ │ ├── cast5.go │ │ └── cast5_test.go │ ├── chacha20poly1305 │ │ ├── chacha20poly1305.go │ │ ├── chacha20poly1305_amd64.go │ │ ├── chacha20poly1305_amd64.s │ │ ├── chacha20poly1305_generic.go │ │ ├── chacha20poly1305_noasm.go │ │ ├── chacha20poly1305_test.go │ │ ├── chacha20poly1305_vectors_test.go │ │ └── internal │ │ │ └── chacha20 │ │ │ ├── chacha_generic.go │ │ │ └── chacha_test.go │ ├── codereview.cfg │ ├── cryptobyte │ │ ├── asn1.go │ │ ├── asn1 │ │ │ └── asn1.go │ │ ├── asn1_test.go │ │ ├── builder.go │ │ ├── cryptobyte_test.go │ │ ├── example_test.go │ │ └── string.go │ ├── curve25519 │ │ ├── const_amd64.h │ │ ├── const_amd64.s │ │ ├── cswap_amd64.s │ │ ├── curve25519.go │ │ ├── curve25519_test.go │ │ ├── doc.go │ │ ├── freeze_amd64.s │ │ ├── ladderstep_amd64.s │ │ ├── mont25519_amd64.go │ │ ├── mul_amd64.s │ │ └── square_amd64.s │ ├── ed25519 │ │ ├── ed25519.go │ │ ├── ed25519_test.go │ │ ├── internal │ │ │ └── edwards25519 │ │ │ │ ├── const.go │ │ │ │ └── edwards25519.go │ │ └── testdata │ │ │ └── sign.input.gz │ ├── hkdf │ │ ├── example_test.go │ │ ├── hkdf.go │ │ └── hkdf_test.go │ ├── md4 │ │ ├── example_test.go │ │ ├── md4.go │ │ ├── md4_test.go │ │ └── md4block.go │ ├── nacl │ │ ├── auth │ │ │ ├── auth.go │ │ │ ├── auth_test.go │ │ │ └── example_test.go │ │ ├── box │ │ │ ├── box.go │ │ │ ├── box_test.go │ │ │ └── example_test.go │ │ └── secretbox │ │ │ ├── example_test.go │ │ │ ├── secretbox.go │ │ │ └── secretbox_test.go │ ├── ocsp │ │ ├── ocsp.go │ │ └── ocsp_test.go │ ├── openpgp │ │ ├── armor │ │ │ ├── armor.go │ │ │ ├── armor_test.go │ │ │ └── encode.go │ │ ├── canonical_text.go │ │ ├── canonical_text_test.go │ │ ├── clearsign │ │ │ ├── clearsign.go │ │ │ └── clearsign_test.go │ │ ├── elgamal │ │ │ ├── elgamal.go │ │ │ └── elgamal_test.go │ │ ├── errors │ │ │ └── errors.go │ │ ├── keys.go │ │ ├── keys_test.go │ │ ├── packet │ │ │ ├── compressed.go │ │ │ ├── compressed_test.go │ │ │ ├── config.go │ │ │ ├── encrypted_key.go │ │ │ ├── encrypted_key_test.go │ │ │ ├── literal.go │ │ │ ├── ocfb.go │ │ │ ├── ocfb_test.go │ │ │ ├── one_pass_signature.go │ │ │ ├── opaque.go │ │ │ ├── opaque_test.go │ │ │ ├── packet.go │ │ │ ├── packet_test.go │ │ │ ├── private_key.go │ │ │ ├── private_key_test.go │ │ │ ├── public_key.go │ │ │ ├── public_key_test.go │ │ │ ├── public_key_v3.go │ │ │ ├── public_key_v3_test.go │ │ │ ├── reader.go │ │ │ ├── signature.go │ │ │ ├── signature_test.go │ │ │ ├── signature_v3.go │ │ │ ├── signature_v3_test.go │ │ │ ├── symmetric_key_encrypted.go │ │ │ ├── symmetric_key_encrypted_test.go │ │ │ ├── symmetrically_encrypted.go │ │ │ ├── symmetrically_encrypted_test.go │ │ │ ├── userattribute.go │ │ │ ├── userattribute_test.go │ │ │ ├── userid.go │ │ │ └── userid_test.go │ │ ├── read.go │ │ ├── read_test.go │ │ ├── s2k │ │ │ ├── s2k.go │ │ │ └── s2k_test.go │ │ ├── write.go │ │ └── write_test.go │ ├── otr │ │ ├── libotr_test_helper.c │ │ ├── otr.go │ │ ├── otr_test.go │ │ └── smp.go │ ├── pbkdf2 │ │ ├── pbkdf2.go │ │ └── pbkdf2_test.go │ ├── pkcs12 │ │ ├── bmp-string.go │ │ ├── bmp-string_test.go │ │ ├── crypto.go │ │ ├── crypto_test.go │ │ ├── errors.go │ │ ├── internal │ │ │ └── rc2 │ │ │ │ ├── bench_test.go │ │ │ │ ├── rc2.go │ │ │ │ └── rc2_test.go │ │ ├── mac.go │ │ ├── mac_test.go │ │ ├── pbkdf.go │ │ ├── pbkdf_test.go │ │ ├── pkcs12.go │ │ ├── pkcs12_test.go │ │ └── safebags.go │ ├── poly1305 │ │ ├── poly1305.go │ │ ├── poly1305_test.go │ │ ├── sum_amd64.go │ │ ├── sum_amd64.s │ │ ├── sum_arm.go │ │ ├── sum_arm.s │ │ └── sum_ref.go │ ├── ripemd160 │ │ ├── ripemd160.go │ │ ├── ripemd160_test.go │ │ └── ripemd160block.go │ ├── salsa20 │ │ ├── salsa │ │ │ ├── hsalsa20.go │ │ │ ├── salsa2020_amd64.s │ │ │ ├── salsa208.go │ │ │ ├── salsa20_amd64.go │ │ │ ├── salsa20_ref.go │ │ │ └── salsa_test.go │ │ ├── salsa20.go │ │ └── salsa20_test.go │ ├── scrypt │ │ ├── example_test.go │ │ ├── scrypt.go │ │ └── scrypt_test.go │ ├── sha3 │ │ ├── doc.go │ │ ├── hashes.go │ │ ├── keccakf.go │ │ ├── keccakf_amd64.go │ │ ├── keccakf_amd64.s │ │ ├── register.go │ │ ├── sha3.go │ │ ├── sha3_test.go │ │ ├── shake.go │ │ ├── testdata │ │ │ └── keccakKats.json.deflate │ │ ├── xor.go │ │ ├── xor_generic.go │ │ └── xor_unaligned.go │ ├── ssh │ │ ├── agent │ │ │ ├── client.go │ │ │ ├── client_test.go │ │ │ ├── example_test.go │ │ │ ├── forward.go │ │ │ ├── keyring.go │ │ │ ├── keyring_test.go │ │ │ ├── server.go │ │ │ ├── server_test.go │ │ │ └── testdata_test.go │ │ ├── benchmark_test.go │ │ ├── buffer.go │ │ ├── buffer_test.go │ │ ├── certs.go │ │ ├── certs_test.go │ │ ├── channel.go │ │ ├── cipher.go │ │ ├── cipher_test.go │ │ ├── client.go │ │ ├── client_auth.go │ │ ├── client_auth_test.go │ │ ├── client_test.go │ │ ├── common.go │ │ ├── connection.go │ │ ├── doc.go │ │ ├── example_test.go │ │ ├── handshake.go │ │ ├── handshake_test.go │ │ ├── kex.go │ │ ├── kex_test.go │ │ ├── keys.go │ │ ├── keys_test.go │ │ ├── knownhosts │ │ │ ├── knownhosts.go │ │ │ └── knownhosts_test.go │ │ ├── mac.go │ │ ├── mempipe_test.go │ │ ├── messages.go │ │ ├── messages_test.go │ │ ├── mux.go │ │ ├── mux_test.go │ │ ├── server.go │ │ ├── session.go │ │ ├── session_test.go │ │ ├── streamlocal.go │ │ ├── tcpip.go │ │ ├── tcpip_test.go │ │ ├── terminal │ │ │ ├── terminal.go │ │ │ ├── terminal_test.go │ │ │ ├── util.go │ │ │ ├── util_bsd.go │ │ │ ├── util_linux.go │ │ │ ├── util_plan9.go │ │ │ ├── util_solaris.go │ │ │ └── util_windows.go │ │ ├── test │ │ │ ├── agent_unix_test.go │ │ │ ├── banner_test.go │ │ │ ├── cert_test.go │ │ │ ├── dial_unix_test.go │ │ │ ├── doc.go │ │ │ ├── forward_unix_test.go │ │ │ ├── session_test.go │ │ │ ├── test_unix_test.go │ │ │ └── testdata_test.go │ │ ├── testdata │ │ │ ├── doc.go │ │ │ └── keys.go │ │ ├── testdata_test.go │ │ ├── transport.go │ │ └── transport_test.go │ ├── tea │ │ ├── cipher.go │ │ └── tea_test.go │ ├── twofish │ │ ├── twofish.go │ │ └── twofish_test.go │ ├── xtea │ │ ├── block.go │ │ ├── cipher.go │ │ └── xtea_test.go │ └── xts │ │ ├── xts.go │ │ └── xts_test.go │ └── sys │ ├── .gitattributes │ ├── .gitignore │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── README.md │ ├── codereview.cfg │ ├── cpu │ ├── asm_aix_ppc64.s │ ├── byteorder.go │ ├── cpu.go │ ├── cpu_aix_ppc64.go │ ├── cpu_arm.go │ ├── cpu_gc_s390x.go │ ├── cpu_gc_x86.go │ ├── cpu_gccgo.c │ ├── cpu_gccgo.go │ ├── cpu_gccgo_s390x.go │ ├── cpu_linux.go │ ├── cpu_linux_arm64.go │ ├── cpu_linux_ppc64x.go │ ├── cpu_linux_s390x.go │ ├── cpu_mips64x.go │ ├── cpu_mipsx.go │ ├── cpu_other_arm64.go │ ├── cpu_s390x.s │ ├── cpu_test.go │ ├── cpu_wasm.go │ ├── cpu_x86.go │ ├── cpu_x86.s │ └── syscall_aix_ppc64_gc.go │ ├── plan9 │ ├── asm.s │ ├── asm_plan9_386.s │ ├── asm_plan9_amd64.s │ ├── const_plan9.go │ ├── dir_plan9.go │ ├── env_plan9.go │ ├── env_unset.go │ ├── errors_plan9.go │ ├── mkall.sh │ ├── mkerrors.sh │ ├── mksyscall.pl │ ├── mksysnum_plan9.sh │ ├── pwd_go15_plan9.go │ ├── pwd_plan9.go │ ├── race.go │ ├── race0.go │ ├── str.go │ ├── syscall.go │ ├── syscall_plan9.go │ ├── syscall_test.go │ ├── zsyscall_plan9_386.go │ ├── zsyscall_plan9_amd64.go │ └── zsysnum_plan9.go │ ├── unix │ ├── .gitignore │ ├── README.md │ ├── asm_darwin_386.s │ ├── asm_darwin_amd64.s │ ├── asm_darwin_arm.s │ ├── asm_darwin_arm64.s │ ├── asm_dragonfly_amd64.s │ ├── asm_freebsd_386.s │ ├── asm_freebsd_amd64.s │ ├── asm_freebsd_arm.s │ ├── asm_linux_386.s │ ├── asm_linux_amd64.s │ ├── asm_linux_arm.s │ ├── asm_linux_arm64.s │ ├── asm_linux_mips64x.s │ ├── asm_linux_mipsx.s │ ├── asm_linux_ppc64x.s │ ├── asm_linux_s390x.s │ ├── asm_netbsd_386.s │ ├── asm_netbsd_amd64.s │ ├── asm_netbsd_arm.s │ ├── asm_openbsd_386.s │ ├── asm_openbsd_amd64.s │ ├── asm_openbsd_arm.s │ ├── asm_solaris_amd64.s │ ├── bluetooth_linux.go │ ├── cap_freebsd.go │ ├── constants.go │ ├── creds_test.go │ ├── dev_darwin.go │ ├── dev_darwin_test.go │ ├── dev_dragonfly.go │ ├── dev_dragonfly_test.go │ ├── dev_freebsd.go │ ├── dev_linux.go │ ├── dev_linux_test.go │ ├── dev_netbsd.go │ ├── dev_netbsd_test.go │ ├── dev_openbsd.go │ ├── dev_openbsd_test.go │ ├── dev_solaris_test.go │ ├── dirent.go │ ├── endian_big.go │ ├── endian_little.go │ ├── env_unix.go │ ├── env_unset.go │ ├── errors_freebsd_386.go │ ├── errors_freebsd_amd64.go │ ├── errors_freebsd_arm.go │ ├── export_test.go │ ├── flock.go │ ├── flock_linux_32bit.go │ ├── gccgo.go │ ├── gccgo_c.c │ ├── gccgo_linux_amd64.go │ ├── linux │ │ ├── Dockerfile │ │ ├── mkall.go │ │ ├── mksysnum.pl │ │ └── types.go │ ├── mkall.sh │ ├── mkerrors.sh │ ├── mkpost.go │ ├── mksyscall.pl │ ├── mksyscall_solaris.pl │ ├── mksysctl_openbsd.pl │ ├── mksysnum_darwin.pl │ ├── mksysnum_dragonfly.pl │ ├── mksysnum_freebsd.pl │ ├── mksysnum_netbsd.pl │ ├── mksysnum_openbsd.pl │ ├── mmap_unix_test.go │ ├── openbsd_pledge.go │ ├── openbsd_test.go │ ├── pagesize_unix.go │ ├── race.go │ ├── race0.go │ ├── sockcmsg_linux.go │ ├── sockcmsg_unix.go │ ├── str.go │ ├── syscall.go │ ├── syscall_bsd.go │ ├── syscall_bsd_test.go │ ├── syscall_darwin.go │ ├── syscall_darwin_386.go │ ├── syscall_darwin_amd64.go │ ├── syscall_darwin_arm.go │ ├── syscall_darwin_arm64.go │ ├── syscall_dragonfly.go │ ├── syscall_dragonfly_amd64.go │ ├── syscall_freebsd.go │ ├── syscall_freebsd_386.go │ ├── syscall_freebsd_amd64.go │ ├── syscall_freebsd_arm.go │ ├── syscall_freebsd_test.go │ ├── syscall_linux.go │ ├── syscall_linux_386.go │ ├── syscall_linux_amd64.go │ ├── syscall_linux_amd64_gc.go │ ├── syscall_linux_arm.go │ ├── syscall_linux_arm64.go │ ├── syscall_linux_mips64x.go │ ├── syscall_linux_mipsx.go │ ├── syscall_linux_ppc64x.go │ ├── syscall_linux_s390x.go │ ├── syscall_linux_sparc64.go │ ├── syscall_linux_test.go │ ├── syscall_netbsd.go │ ├── syscall_netbsd_386.go │ ├── syscall_netbsd_amd64.go │ ├── syscall_netbsd_arm.go │ ├── syscall_openbsd.go │ ├── syscall_openbsd_386.go │ ├── syscall_openbsd_amd64.go │ ├── syscall_openbsd_arm.go │ ├── syscall_solaris.go │ ├── syscall_solaris_amd64.go │ ├── syscall_solaris_test.go │ ├── syscall_test.go │ ├── syscall_unix.go │ ├── syscall_unix_gc.go │ ├── syscall_unix_test.go │ ├── timestruct.go │ ├── timestruct_test.go │ ├── types_darwin.go │ ├── types_dragonfly.go │ ├── types_freebsd.go │ ├── types_netbsd.go │ ├── types_openbsd.go │ ├── types_solaris.go │ ├── zerrors_darwin_386.go │ ├── zerrors_darwin_amd64.go │ ├── zerrors_darwin_arm.go │ ├── zerrors_darwin_arm64.go │ ├── zerrors_dragonfly_amd64.go │ ├── zerrors_freebsd_386.go │ ├── zerrors_freebsd_amd64.go │ ├── zerrors_freebsd_arm.go │ ├── zerrors_linux_386.go │ ├── zerrors_linux_amd64.go │ ├── zerrors_linux_arm.go │ ├── zerrors_linux_arm64.go │ ├── zerrors_linux_mips.go │ ├── zerrors_linux_mips64.go │ ├── zerrors_linux_mips64le.go │ ├── zerrors_linux_mipsle.go │ ├── zerrors_linux_ppc64.go │ ├── zerrors_linux_ppc64le.go │ ├── zerrors_linux_s390x.go │ ├── zerrors_linux_sparc64.go │ ├── zerrors_netbsd_386.go │ ├── zerrors_netbsd_amd64.go │ ├── zerrors_netbsd_arm.go │ ├── zerrors_openbsd_386.go │ ├── zerrors_openbsd_amd64.go │ ├── zerrors_openbsd_arm.go │ ├── zerrors_solaris_amd64.go │ ├── zptrace386_linux.go │ ├── zptracearm_linux.go │ ├── zptracemips_linux.go │ ├── zptracemipsle_linux.go │ ├── zsyscall_darwin_386.go │ ├── zsyscall_darwin_amd64.go │ ├── zsyscall_darwin_arm.go │ ├── zsyscall_darwin_arm64.go │ ├── zsyscall_dragonfly_amd64.go │ ├── zsyscall_freebsd_386.go │ ├── zsyscall_freebsd_amd64.go │ ├── zsyscall_freebsd_arm.go │ ├── zsyscall_linux_386.go │ ├── zsyscall_linux_amd64.go │ ├── zsyscall_linux_arm.go │ ├── zsyscall_linux_arm64.go │ ├── zsyscall_linux_mips.go │ ├── zsyscall_linux_mips64.go │ ├── zsyscall_linux_mips64le.go │ ├── zsyscall_linux_mipsle.go │ ├── zsyscall_linux_ppc64.go │ ├── zsyscall_linux_ppc64le.go │ ├── zsyscall_linux_s390x.go │ ├── zsyscall_linux_sparc64.go │ ├── zsyscall_netbsd_386.go │ ├── zsyscall_netbsd_amd64.go │ ├── zsyscall_netbsd_arm.go │ ├── zsyscall_openbsd_386.go │ ├── zsyscall_openbsd_amd64.go │ ├── zsyscall_openbsd_arm.go │ ├── zsyscall_solaris_amd64.go │ ├── zsysctl_openbsd_386.go │ ├── zsysctl_openbsd_amd64.go │ ├── zsysctl_openbsd_arm.go │ ├── zsysnum_darwin_386.go │ ├── zsysnum_darwin_amd64.go │ ├── zsysnum_darwin_arm.go │ ├── zsysnum_darwin_arm64.go │ ├── zsysnum_dragonfly_amd64.go │ ├── zsysnum_freebsd_386.go │ ├── zsysnum_freebsd_amd64.go │ ├── zsysnum_freebsd_arm.go │ ├── zsysnum_linux_386.go │ ├── zsysnum_linux_amd64.go │ ├── zsysnum_linux_arm.go │ ├── zsysnum_linux_arm64.go │ ├── zsysnum_linux_mips.go │ ├── zsysnum_linux_mips64.go │ ├── zsysnum_linux_mips64le.go │ ├── zsysnum_linux_mipsle.go │ ├── zsysnum_linux_ppc64.go │ ├── zsysnum_linux_ppc64le.go │ ├── zsysnum_linux_s390x.go │ ├── zsysnum_linux_sparc64.go │ ├── zsysnum_netbsd_386.go │ ├── zsysnum_netbsd_amd64.go │ ├── zsysnum_netbsd_arm.go │ ├── zsysnum_openbsd_386.go │ ├── zsysnum_openbsd_amd64.go │ ├── zsysnum_openbsd_arm.go │ ├── ztypes_darwin_386.go │ ├── ztypes_darwin_amd64.go │ ├── ztypes_darwin_arm.go │ ├── ztypes_darwin_arm64.go │ ├── ztypes_dragonfly_amd64.go │ ├── ztypes_freebsd_386.go │ ├── ztypes_freebsd_amd64.go │ ├── ztypes_freebsd_arm.go │ ├── ztypes_linux_386.go │ ├── ztypes_linux_amd64.go │ ├── ztypes_linux_arm.go │ ├── ztypes_linux_arm64.go │ ├── ztypes_linux_mips.go │ ├── ztypes_linux_mips64.go │ ├── ztypes_linux_mips64le.go │ ├── ztypes_linux_mipsle.go │ ├── ztypes_linux_ppc64.go │ ├── ztypes_linux_ppc64le.go │ ├── ztypes_linux_s390x.go │ ├── ztypes_linux_sparc64.go │ ├── ztypes_netbsd_386.go │ ├── ztypes_netbsd_amd64.go │ ├── ztypes_netbsd_arm.go │ ├── ztypes_openbsd_386.go │ ├── ztypes_openbsd_amd64.go │ ├── ztypes_openbsd_arm.go │ └── ztypes_solaris_amd64.go │ └── windows │ ├── asm_windows_386.s │ ├── asm_windows_amd64.s │ ├── dll_windows.go │ ├── env_unset.go │ ├── env_windows.go │ ├── eventlog.go │ ├── exec_windows.go │ ├── memory_windows.go │ ├── mksyscall.go │ ├── race.go │ ├── race0.go │ ├── registry │ ├── export_test.go │ ├── key.go │ ├── mksyscall.go │ ├── registry_test.go │ ├── syscall.go │ ├── value.go │ └── zsyscall_windows.go │ ├── security_windows.go │ ├── service.go │ ├── str.go │ ├── svc │ ├── debug │ │ ├── log.go │ │ └── service.go │ ├── event.go │ ├── eventlog │ │ ├── install.go │ │ ├── log.go │ │ └── log_test.go │ ├── example │ │ ├── beep.go │ │ ├── install.go │ │ ├── main.go │ │ ├── manage.go │ │ └── service.go │ ├── go12.c │ ├── go12.go │ ├── go13.go │ ├── mgr │ │ ├── config.go │ │ ├── mgr.go │ │ ├── mgr_test.go │ │ └── service.go │ ├── security.go │ ├── service.go │ ├── svc_test.go │ ├── sys_386.s │ └── sys_amd64.s │ ├── syscall.go │ ├── syscall_test.go │ ├── syscall_windows.go │ ├── syscall_windows_test.go │ ├── types_windows.go │ ├── types_windows_386.go │ ├── types_windows_amd64.go │ └── zsyscall_windows.go ├── gopkg.in └── yaml.v1 │ ├── LICENSE │ ├── LICENSE.libyaml │ ├── README.md │ ├── apic.go │ ├── decode.go │ ├── decode_test.go │ ├── emitterc.go │ ├── encode.go │ ├── encode_test.go │ ├── parserc.go │ ├── readerc.go │ ├── resolve.go │ ├── scannerc.go │ ├── sorter.go │ ├── suite_test.go │ ├── writerc.go │ ├── yaml.go │ ├── yamlh.go │ └── yamlprivateh.go └── pifke.org └── wpasupplicant ├── .travis.yml ├── LICENSE.txt ├── README.md ├── unixgram.go ├── unixgram_test.go └── wpasupplicant.go /.dockerignore: -------------------------------------------------------------------------------- 1 | build 2 | Dockerfile 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | debian/changelog 3 | pkg/ 4 | .vscode/ -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG IMAGE 2 | FROM ${IMAGE} 3 | 4 | ARG GO_TAGS 5 | ENV GO_TAGS=${GO_TAGS} 6 | 7 | RUN apt-get update && apt-get install -y --no-install-recommends \ 8 | git build-essential \ 9 | debhelper devscripts fakeroot git-buildpackage dh-make dh-systemd dh-golang \ 10 | libcairo2-dev \ 11 | libgtk-3-dev 12 | 13 | # We cache go get gtk, to speed up builds. 14 | #RUN go get -tags ${GO_TAGS} -v github.com/gotk3/gotk3/gtk/... 15 | 16 | ADD . ${GOPATH}/src/github.com/Z-Bolt/OctoScreen/ 17 | #RUN go get -tags ${GO_TAGS} -v ./... 18 | 19 | WORKDIR ${GOPATH}/src/github.com/Z-Bolt/OctoScreen/ 20 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /debian/gbp.conf: -------------------------------------------------------------------------------- 1 | [DEFAULT] 2 | pristine-tar = True 3 | -------------------------------------------------------------------------------- /debian/local/insserv.conf.d/octoscreen: -------------------------------------------------------------------------------- 1 | $x-display-manager octoscreen 2 | -------------------------------------------------------------------------------- /debian/local/octoscreen/disablescreenblank.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | screen=${1:-0} 4 | 5 | # wait 10s for the display manager service to start and attach to screen 6 | sleep 10 7 | 8 | /usr/bin/xset -display :$screen s off # deactivate screen saver 9 | /usr/bin/xset -display :$screen -dpms # disable DPMS 10 | /usr/bin/xset -display :$screen s noblank # disable screen blanking -------------------------------------------------------------------------------- /debian/octoscreen.install: -------------------------------------------------------------------------------- 1 | debian/local/octoscreen etc 2 | debian/local/insserv.conf.d etc -------------------------------------------------------------------------------- /debian/octoscreen.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=OctoScreen 3 | Conflicts=getty@tty7.service 4 | After=systemd-user-sessions.service getty@tty7.service plymouth-quit.service 5 | 6 | [Service] 7 | Type=notify 8 | NotifyAccess=all 9 | EnvironmentFile=/etc/octoscreen/config 10 | ExecStart=/usr/bin/xinit /usr/bin/OctoScreen -- :0 -nolisten tcp -nocursor 11 | ExecStartPost=/bin/bash /etc/octoscreen/disablescreenblank.sh 0 12 | StandardOutput=journal 13 | Restart=always 14 | WatchdogSec=40s 15 | 16 | [Install] 17 | WantedBy=graphical.target 18 | Alias=display-manager.service 19 | -------------------------------------------------------------------------------- /debian/octoscreen.templates: -------------------------------------------------------------------------------- 1 | Template: shared/default-x-display-manager 2 | Type: select 3 | Choices: ${choices} 4 | Description: Default display manager: 5 | A display manager is a program that provides graphical login capabilities for 6 | the X Window System. 7 | . 8 | Only one display manager can manage a given X server, but multiple display 9 | manager packages are installed. Please select which display manager should 10 | run by default. 11 | . 12 | Multiple display managers can run simultaneously if they are configured to 13 | manage different servers; to achieve this, configure the display managers 14 | accordingly, edit each of their init scripts in /etc/init.d, and disable the 15 | check for a default display manager. 16 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /debian/watch: -------------------------------------------------------------------------------- 1 | version=3 2 | opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/octoscreen-\$1\.tar\.gz/,\ 3 | uversionmangle=s/(\d)[_\.\-\+]?(RC|rc|pre|dev|beta|alpha)[.]?(\d*)$/\$1~\$2\$3/ \ 4 | https://github.com/Z-Bolt/OctoScreen/tags .*/v?(\d\S*)\.tar\.gz 5 | -------------------------------------------------------------------------------- /docs/img/bed-level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/docs/img/bed-level.png -------------------------------------------------------------------------------- /docs/img/control.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/docs/img/control.png -------------------------------------------------------------------------------- /docs/img/fan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/docs/img/fan.png -------------------------------------------------------------------------------- /docs/img/filament.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/docs/img/filament.png -------------------------------------------------------------------------------- /docs/img/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/docs/img/home.png -------------------------------------------------------------------------------- /docs/img/move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/docs/img/move.png -------------------------------------------------------------------------------- /docs/img/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/docs/img/network.png -------------------------------------------------------------------------------- /docs/img/system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/docs/img/system.png -------------------------------------------------------------------------------- /docs/img/temperature-presets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/docs/img/temperature-presets.png -------------------------------------------------------------------------------- /docs/img/temperature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/docs/img/temperature.png -------------------------------------------------------------------------------- /docs/img/tool-changer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/docs/img/tool-changer.png -------------------------------------------------------------------------------- /docs/img/z-offset-calibration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/docs/img/z-offset-calibration.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /interfaces/IPanel.go: -------------------------------------------------------------------------------- 1 | package interfaces 2 | 3 | import ( 4 | "github.com/gotk3/gotk3/gtk" 5 | ) 6 | 7 | type IPanel interface { 8 | Name() string 9 | Grid() *gtk.Grid 10 | PreShow() 11 | Show() 12 | Hide() 13 | // maybe add PostShow(), PreHide(), and PostHide() 14 | } 15 | -------------------------------------------------------------------------------- /interfaces/ITemperatureDataDisplay.go: -------------------------------------------------------------------------------- 1 | package interfaces 2 | 3 | import ( 4 | // "github.com/Z-Bolt/OctoScreen/octoprintApis" 5 | "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 6 | ) 7 | 8 | type ITemperatureDataDisplay interface { 9 | UpdateTemperatureData(temperatureData map[string]dataModels.TemperatureData) 10 | } 11 | -------------------------------------------------------------------------------- /logger/contextHook.go: -------------------------------------------------------------------------------- 1 | package logger 2 | 3 | import ( 4 | // "io" 5 | // "os" 6 | "path" 7 | "runtime" 8 | "strings" 9 | // "time" 10 | 11 | "github.com/sirupsen/logrus" 12 | ) 13 | 14 | 15 | type ContextHook struct{} 16 | 17 | func (hook ContextHook) Levels() []logrus.Level { 18 | return logrus.AllLevels 19 | } 20 | 21 | func (hook ContextHook) Fire(entry *logrus.Entry) error { 22 | pc := make([]uintptr, 3, 3) 23 | cnt := runtime.Callers(6, pc) 24 | 25 | for i := 0; i < cnt; i++ { 26 | fu := runtime.FuncForPC(pc[i] - 1) 27 | name := fu.Name() 28 | if !strings.Contains(strings.ToLower(name), "github.com/sirupsen/logrus") { 29 | file, line := fu.FileLine(pc[i] - 1) 30 | entry.Data["file"] = path.Base(file) 31 | entry.Data["func"] = path.Base(name) 32 | entry.Data["line"] = line 33 | break 34 | } 35 | } 36 | 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /octoprintApis/CancelRequest.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | // "io" 7 | 8 | // "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 9 | ) 10 | 11 | 12 | // CancelRequest cancels the current print job. 13 | type CancelRequest struct{} 14 | 15 | // Do sends an API request and returns an error if any. 16 | func (cmd *CancelRequest) Do(c *Client) error { 17 | payload := map[string]string{"command": "cancel"} 18 | 19 | buffer := bytes.NewBuffer(nil) 20 | if err := json.NewEncoder(buffer).Encode(payload); err != nil { 21 | return err 22 | } 23 | 24 | _, err := c.doJsonRequest("POST", JobApiUri, buffer, JobToolErrors, true) 25 | return err 26 | } 27 | -------------------------------------------------------------------------------- /octoprintApis/CustomCommandsRequest.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | // "bytes" 5 | "encoding/json" 6 | // "fmt" 7 | // "io" 8 | // "strings" 9 | 10 | "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 11 | ) 12 | 13 | 14 | // CustomCommandsRequest retrieves all configured system controls. 15 | type CustomCommandsRequest struct{} 16 | 17 | // Do sends an API request and returns the API response. 18 | func (cmd *CustomCommandsRequest) Do(c *Client) (*dataModels.CustomCommandsResponse, error) { 19 | bytes, err := c.doJsonRequest("GET", PrinterCommandCustomApiUri, nil, nil, true) 20 | if err != nil { 21 | return nil, err 22 | } 23 | 24 | response := &dataModels.CustomCommandsResponse{} 25 | if err := json.Unmarshal(bytes, response); err != nil { 26 | return nil, err 27 | } 28 | 29 | return response, err 30 | } 31 | -------------------------------------------------------------------------------- /octoprintApis/DeleteFileRequest.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 7 | ) 8 | 9 | 10 | // DeleteFileRequest delete the selected path on the selected location. 11 | type DeleteFileRequest struct { 12 | // Location is the target location on which to delete the file, either 13 | // `local` (for OctoPrint’s uploads folder) or \sdcard\ for the printer’s 14 | // SD card (if available) 15 | Location dataModels.Location 16 | 17 | // Path of the file to delete 18 | Path string 19 | } 20 | 21 | // Do sends an API request and returns error if any. 22 | func (req *DeleteFileRequest) Do(c *Client) error { 23 | uri := fmt.Sprintf("%s/%s/%s", FilesApiUri, req.Location, req.Path) 24 | if _, err := c.doJsonRequest("DELETE", uri, nil, FilesLocationDeleteErrors, true); err != nil { 25 | return err 26 | } 27 | 28 | return nil 29 | } 30 | -------------------------------------------------------------------------------- /octoprintApis/JobRequest.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | // "bytes" 5 | "encoding/json" 6 | // "io" 7 | 8 | "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 9 | ) 10 | 11 | 12 | // JobRequest retrieve information about the current job (if there is one). 13 | type JobRequest struct{} 14 | 15 | 16 | // Do sends an API request and returns the API response. 17 | func (cmd *JobRequest) Do(client *Client) (*dataModels.JobResponse, error) { 18 | bytes, err := client.doJsonRequest("GET", JobApiUri, nil, nil, true) 19 | if err != nil { 20 | return nil, err 21 | } 22 | 23 | response := &dataModels.JobResponse{} 24 | if err := json.Unmarshal(bytes, response); err != nil { 25 | return nil, err 26 | } 27 | 28 | return response, err 29 | } 30 | -------------------------------------------------------------------------------- /octoprintApis/NotificationRequest.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | // "bytes" 5 | "encoding/json" 6 | "fmt" 7 | 8 | "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 9 | ) 10 | 11 | 12 | type NotificationRequest struct { 13 | Command string `json:"command"` 14 | } 15 | 16 | func (this *NotificationRequest) Do(client *Client, uiState string) (*dataModels.NotificationResponse, error) { 17 | if uiState != "splash" && uiState != "idle" { 18 | return nil, nil 19 | } 20 | 21 | target := fmt.Sprintf("%s?command=get_notification", PluginZBoltOctoScreenApiUri) 22 | bytes, err := client.doJsonRequest("GET", target, nil, ConnectionErrors, true) 23 | if err != nil { 24 | return nil, err 25 | } 26 | 27 | response := &dataModels.NotificationResponse{} 28 | if err := json.Unmarshal(bytes, response); err != nil { 29 | return nil, err 30 | } 31 | 32 | return response, err 33 | } 34 | -------------------------------------------------------------------------------- /octoprintApis/PrinterProfilesRequest.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | 7 | "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 8 | ) 9 | 10 | 11 | // SettingsRequest retrieves the current configuration of OctoPrint. 12 | type PrinterProfilesRequest struct { 13 | Id string 14 | } 15 | 16 | // Do sends an API request and returns the API response. 17 | func (cmd *PrinterProfilesRequest) Do(c *Client) (*dataModels.PrinterProfileResponse, error) { 18 | uri := fmt.Sprintf("/api/printerprofiles/%s", cmd.Id) 19 | bytes, err := c.doJsonRequest("GET", uri, nil, nil, true) 20 | if err != nil { 21 | return nil, err 22 | } 23 | 24 | response := &dataModels.PrinterProfileResponse{} 25 | if err := json.Unmarshal(bytes, response); err != nil { 26 | return nil, err 27 | } 28 | 29 | return response, err 30 | } 31 | -------------------------------------------------------------------------------- /octoprintApis/RestartRequest.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | // "io" 7 | 8 | // "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 9 | ) 10 | 11 | 12 | // RestartRequest restart the print of the currently selected file from the 13 | // beginning. There must be an active print job for this to work and the print 14 | // job must currently be paused 15 | type RestartRequest struct{} 16 | 17 | // Do sends an API request and returns an error if any. 18 | func (cmd *RestartRequest) Do(c *Client) error { 19 | payload := map[string]string{"command": "restart"} 20 | 21 | buffer := bytes.NewBuffer(nil) 22 | if err := json.NewEncoder(buffer).Encode(payload); err != nil { 23 | return err 24 | } 25 | 26 | _, err := c.doJsonRequest("POST", JobApiUri, buffer, JobToolErrors, true) 27 | return err 28 | } 29 | -------------------------------------------------------------------------------- /octoprintApis/RunZOffsetCalibrationRequest.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | // "fmt" 7 | 8 | "github.com/Z-Bolt/OctoScreen/logger" 9 | ) 10 | 11 | 12 | type RunZOffsetCalibrationRequest struct { 13 | Command string `json:"command"` 14 | } 15 | 16 | func (this *RunZOffsetCalibrationRequest) Do(client *Client) error { 17 | this.Command = "run_zoffset_calibration" 18 | 19 | buffer := bytes.NewBuffer(nil) 20 | if err := json.NewEncoder(buffer).Encode(this); err != nil { 21 | logger.LogError("RunZOffsetCalibrationRequest.Do()", "json.NewEncoder(params).Encode(this)", err) 22 | return err 23 | } 24 | 25 | _, err := client.doJsonRequest("POST", PluginZBoltOctoScreenApiUri, buffer, ConnectionErrors, true) 26 | return err 27 | } 28 | -------------------------------------------------------------------------------- /octoprintApis/SdInitRequest.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | // "bytes" 5 | // "encoding/json" 6 | // "fmt" 7 | // "io" 8 | // "strings" 9 | 10 | // "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 11 | ) 12 | 13 | 14 | // SdInitRequest initializes the printer’s SD card, making it available for use. 15 | // This also includes an initial retrieval of the list of files currently stored 16 | // on the SD card. 17 | type SdInitRequest struct{} 18 | 19 | // Do sends an API request and returns an error if any. 20 | func (cmd *SdInitRequest) Do(c *Client) error { 21 | return doCommandRequest(c, PrinterSdApiUri, "init", PrintSdErrors) 22 | } 23 | -------------------------------------------------------------------------------- /octoprintApis/SdRefreshRequest.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | // "bytes" 5 | // "encoding/json" 6 | // "fmt" 7 | // "io" 8 | // "strings" 9 | 10 | // "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 11 | ) 12 | 13 | 14 | // SdRefreshRequest Refreshes the list of files stored on the printer’s SD card. 15 | type SdRefreshRequest struct{} 16 | 17 | // Do sends an API request and returns an error if any. 18 | func (cmd *SdRefreshRequest) Do(c *Client) error { 19 | return doCommandRequest(c, PrinterSdApiUri, "refresh", PrintSdErrors) 20 | } 21 | -------------------------------------------------------------------------------- /octoprintApis/SdReleaseRequest.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | // "bytes" 5 | // "encoding/json" 6 | // "fmt" 7 | // "io" 8 | // "strings" 9 | 10 | // "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 11 | ) 12 | 13 | 14 | // SdReleaseRequest releases the SD card from the printer. The reverse operation 15 | // to init. After issuing this command, the SD card won’t be available anymore, 16 | // hence and operations targeting files stored on it will fail. 17 | type SdReleaseRequest struct{} 18 | 19 | // Do sends an API request and returns an error if any. 20 | func (cmd *SdReleaseRequest) Do(c *Client) error { 21 | return doCommandRequest(c, PrinterSdApiUri, "release", PrintSdErrors) 22 | } 23 | -------------------------------------------------------------------------------- /octoprintApis/StartRequest.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | // "io" 7 | 8 | // "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 9 | ) 10 | 11 | 12 | // StartRequest starts the print of the currently selected file. 13 | type StartRequest struct{} 14 | 15 | // Do sends an API request and returns an error if any. 16 | func (cmd *StartRequest) Do(c *Client) error { 17 | payload := map[string]string{"command": "start"} 18 | 19 | buffer := bytes.NewBuffer(nil) 20 | if err := json.NewEncoder(buffer).Encode(payload); err != nil { 21 | return err 22 | } 23 | 24 | _, err := c.doJsonRequest("POST", JobApiUri, buffer, JobToolErrors, true) 25 | return err 26 | } 27 | -------------------------------------------------------------------------------- /octoprintApis/StatusMapping.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | // "errors" 5 | "fmt" 6 | // "io" 7 | // "io/ioutil" 8 | // "net/http" 9 | // "net/url" 10 | // "time" 11 | ) 12 | 13 | 14 | type StatusMapping map[int]string 15 | 16 | func (this *StatusMapping) Error(code int) error { 17 | err, ok := (*this)[code] 18 | if ok { 19 | return fmt.Errorf(err) 20 | } 21 | 22 | return nil 23 | } 24 | -------------------------------------------------------------------------------- /octoprintApis/common.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | var Version = "0.1" 4 | -------------------------------------------------------------------------------- /octoprintApis/connection.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | // "bytes" 5 | // "encoding/json" 6 | // "io" 7 | 8 | // "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 9 | ) 10 | 11 | 12 | const ConnectionApiUri = "/api/connection" 13 | 14 | 15 | var ConnectionErrors = StatusMapping { 16 | 400: "The selected port or baudrate for a connect command are not part of the available option", 17 | } 18 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/ApiConfig.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | // APIConfig REST API settings. 5 | type APIConfig struct { 6 | // Enabled whether to enable the API. 7 | IsEnabled bool `json:"enabled"` 8 | 9 | // Key current API key needed for accessing the API 10 | Key string `json:"key"` 11 | } 12 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/Axis.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | type Axis string 5 | 6 | const ( 7 | XAxis Axis = "x" 8 | YAxis Axis = "y" 9 | ZAxis Axis = "z" 10 | ) 11 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/CommandSource.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | // CommandSource is the source of the command definition. 5 | type CommandSource string 6 | 7 | const ( 8 | // Core for system actions defined by OctoPrint itself. 9 | Core CommandSource = "core" 10 | 11 | // Custom for custom system commands defined by the user through `config.yaml`. 12 | Custom CommandSource = "custom" 13 | ) 14 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/ControlContainer.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | // ControlContainer describes a control container. 5 | type ControlContainer struct { 6 | // Name to display above the container, basically a section header. 7 | Name string `json:"name"` 8 | 9 | // Gcode command 10 | Command string `json:"command"` 11 | 12 | // Script that will be run on click 13 | Script string `json:"script"` 14 | 15 | // Children a list of children controls or containers contained within this 16 | // container. 17 | Children []*ControlDefinition `json:"children"` 18 | 19 | // Layout to use for laying out the contained children, either from top to 20 | // bottom (`vertical`) or from left to right (`horizontal``). Defaults to a 21 | // vertical layout. 22 | Layout string `json:"layout"` 23 | } 24 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/CustomCommandsResponse.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | // CustomCommandsResponse is the response to a CustomCommandsRequest. 5 | type CustomCommandsResponse struct { 6 | Controls []*ControlContainer `json:"controls"` 7 | } 8 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/Filament.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | type Filament struct { 5 | // Length estimated of filament used, in mm 6 | Length uint32 `json:"length"` 7 | 8 | // Volume estimated of filament used, in cm³ 9 | Volume float64 `json:"volume"` 10 | } 11 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/FilesResponse.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | // FilesResponse is the response to a FilesRequest. 5 | type FilesResponse struct { 6 | // Files is the list of requested files. Might be an empty list if no files are available 7 | Files []*FileResponse 8 | 9 | // 10 | Children []*FileResponse 11 | 12 | // Free is the amount of disk space in bytes available in the local disk 13 | // space (refers to OctoPrint’s `uploads` folder). Only returned if file 14 | // list was requested for origin `local` or all origins. 15 | Free uint64 16 | } 17 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/FullStateResponse.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | // FullStateResponse contains informantion about the current state of the printer. 4 | type FullStateResponse struct { 5 | // TemperatureStateResponse is the printer’s temperature state data. 6 | Temperature TemperatureStateResponse `json:"temperature"` 7 | 8 | // SD is the printer’s sd state data. 9 | SD SdState `json:"sd"` 10 | 11 | // State is the printer’s general state. 12 | State PrinterState `json:"state"` 13 | } 14 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/GCodeAnalysisInformation.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | // GCodeAnalysisInformation Information from the analysis of the GCODE file. 4 | type GCodeAnalysisInformation struct { 5 | // EstimatedPrintTime is the estimated print time of the file, in seconds. 6 | EstimatedPrintTime float64 `json:"estimatedPrintTime"` 7 | 8 | // Filament estimated usage of filament 9 | Filament Filament `json:"filament"` 10 | } 11 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/JobResponse.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | // Job information response 4 | // https://docs.octoprint.org/en/master/api/job.html#job-information-response 5 | 6 | // Job information response 7 | // https://docs.octoprint.org/en/master/api/job.html#job-information-response 8 | 9 | // JobResponse is the response from a job command. 10 | type JobResponse struct { 11 | // Job contains information regarding the target of the current print job. 12 | Job JobInformation `json:"job"` 13 | 14 | // Progress contains information regarding the progress of the current job. 15 | Progress ProgressInformation `json:"progress"` 16 | 17 | //State StateInformation `json:"state"` 18 | State string `json:"state"` 19 | } 20 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/JsonTime.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | import ( 4 | // "encoding/json" 5 | "strconv" 6 | "strings" 7 | "time" 8 | ) 9 | 10 | type JsonTime struct{ time.Time } 11 | 12 | func (t JsonTime) MarshalJSON() ([]byte, error) { 13 | return []byte(strconv.FormatInt(time.Time(t.Time).Unix(), 10)), nil 14 | } 15 | 16 | func (t *JsonTime) UnmarshalJSON(s []byte) (err error) { 17 | r := strings.Replace(string(s), `"`, ``, -1) 18 | if r == "null" { 19 | return nil 20 | } 21 | 22 | q, err := strconv.ParseInt(r, 10, 64) 23 | if err != nil { 24 | return err 25 | } 26 | 27 | t.Time = time.Unix(q, 0) 28 | return 29 | } 30 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/Location.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | type Location string 4 | 5 | const ( 6 | // URIFiles = "/api/files" 7 | 8 | Local Location = "local" 9 | SDCard Location = "sdcard" 10 | ) 11 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/MenuItem.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | type MenuItem struct { 5 | Name string `json:"name"` 6 | Icon string `json:"icon"` 7 | Panel string `json:"panel"` 8 | Items []MenuItem `json:"items"` 9 | } 10 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/NotificationResponse.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | type NotificationResponse struct { 5 | // Job contains information regarding the target of the current print job. 6 | Message string `json:"message"` 7 | } 8 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/OctoScreenSettingsResponse.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | type OctoScreenSettingsResponse struct { 5 | // Job contains information regarding the target of the current print job. 6 | FilamentInLength float64 `json:"filament_in_length"` 7 | FilamentOutLength float64 `json:"filament_out_length"` 8 | ToolChanger bool `json:"toolchanger"` 9 | XAxisInverted bool `json:"x_axis_inverted"` 10 | YAxisInverted bool `json:"y_axis_inverted"` 11 | ZAxisInverted bool `json:"z_axis_inverted"` 12 | MenuStructure []MenuItem `json:"menu_structure"` 13 | GCodes struct { 14 | AutoBedLevel string `json:"auto_bed_level"` 15 | } `json:"gcodes"` 16 | } 17 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/PauseAction.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | type PauseAction string 4 | 5 | const ( 6 | // Pause the current job if it’s printing, does nothing if it’s already paused. 7 | Pause PauseAction = "pause" 8 | 9 | // Resume the current job if it’s paused, does nothing if it’s printing. 10 | Resume PauseAction = "resume" 11 | 12 | // Toggle the pause state of the job, pausing it if it’s printing and 13 | // resuming it if it’s currently paused. 14 | Toggle PauseAction = "toggle" 15 | ) 16 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/PluginManagerInfoResponse.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | // PluginManagerInfoResponse - 5 | type PluginManagerInfoResponse struct { 6 | Octoprint string `json:"octoprint"` 7 | IsOnline bool `json:"online"` 8 | //orphan_data: { } 9 | OS string `json:"os"` 10 | //pip: {} 11 | Plugins []Plugin `json:"plugins"` 12 | } 13 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/PrintStats.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | // PrintStats information from the print stats of a file. 5 | type PrintStats struct { 6 | // Failure number of failed prints. 7 | Failure int `json:"failure"` 8 | 9 | // Success number of success prints. 10 | SuccessfullPrintCount int `json:"success"` 11 | 12 | // Last print information. 13 | Last struct { 14 | // Date of the last print. 15 | Date JsonTime `json:"date"` 16 | 17 | // Success or not. 18 | IsSuccess bool `json:"success"` 19 | } `json:"last"` 20 | } 21 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/PrinterProfileResponse.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | type PrinterProfileResponse struct { 5 | Id string `json:"id"` 6 | Name string `json:"name"` 7 | 8 | Volume struct { 9 | FormFactor string `json:"formFactor"` 10 | Origin string `json:"origin"` 11 | Width float64 `json:"width"` 12 | Depth float64 `json:"depth"` 13 | Height float64 `json:"height"` 14 | } `json:"volume"` 15 | 16 | Extruder struct { 17 | Count int `json:"count"` 18 | HasSharedNozzle bool `json:"sharedNozzle"` 19 | } `json:"extruder"` 20 | } 21 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/PrinterProfilesResponse.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | type PrinterProfilesResponse struct { 5 | Profiles []*PrinterProfileResponse `json:"profiles"` 6 | } 7 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/PrinterState.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | // PrinterState current state of the printer. 5 | type PrinterState struct { 6 | Text string `json:"text"` 7 | Flags struct { 8 | Operations bool `json:"operational"` 9 | Paused bool `json:"paused"` 10 | Printing bool `json:"printing"` 11 | SDReady bool `json:"sdReady"` 12 | Error bool `json:"error"` 13 | Ready bool `json:"ready"` 14 | ClosedOnError bool `json:"closedOrError"` 15 | } `json:"flags"` 16 | } 17 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/Profile.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | // Profile describe a printer profile. 4 | type Profile struct { 5 | // ID is the identifier of the profile. 6 | ID string `json:"id"` 7 | 8 | // Name is the display name of the profile. 9 | Name string `json:"name"` 10 | } 11 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/Reference.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | // Reference of a file. 5 | type Reference struct { 6 | // Resource that represents the file or folder (e.g. for issuing commands 7 | // to or for deleting) 8 | Resource string `json:"resource"` 9 | 10 | // Download URL for the file. Never present for folders. 11 | Download string `json:"download"` 12 | 13 | // Model from which this file was generated (e.g. an STL, currently not 14 | // used). Never present for folders. 15 | Model string `json:"model"` 16 | } 17 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/SdState.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | // SdState is the state of the sd reader. 5 | type SdState struct { 6 | IsReady bool `json:"ready"` 7 | } 8 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/SystemCommandsResponse.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | // SystemCommandsResponse is the response to a SystemCommandsRequest. 5 | type SystemCommandsResponse struct { 6 | Core []*CommandDefinition `json:"core"` 7 | Custom []*CommandDefinition `json:"custom"` 8 | } 9 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/TemperatureConfig.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | // TemperatureConfig temperature profiles which will be displayed in the 5 | // temperature tab. 6 | type TemperatureConfig struct { 7 | // Graph cutoff in minutes. 8 | Cutoff int `json:"cutoff"` 9 | 10 | // Profiles which will be displayed in the temperature tab. 11 | TemperaturePresets []*TemperaturePreset `json:"profiles"` 12 | 13 | // SendAutomatically enable this to have temperature fine adjustments you 14 | // do via the + or - button be sent to the printer automatically. 15 | SendAutomatically bool `json:"sendAutomatically"` 16 | 17 | // SendAutomaticallyAfter OctoPrint will use this delay to limit the number 18 | // of sent temperature commands should you perform multiple fine adjustments 19 | // in a short time. 20 | SendAutomaticallyAfter float64 `json:"sendAutomaticallyAfter"` 21 | } 22 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/TemperatureData.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | import ( 4 | // "encoding/json" 5 | // "strconv" 6 | // "strings" 7 | // "time" 8 | ) 9 | 10 | 11 | // TemperatureData is temperature stats for a tool. 12 | type TemperatureData struct { 13 | // Actual current temperature. 14 | Actual float64 `json:"actual"` 15 | 16 | // Target temperature, may be nil if no target temperature is set. 17 | Target float64 `json:"target"` 18 | 19 | // Offset currently configured temperature offset to apply, will be left 20 | // out for historic temperature information. 21 | Offset float64 `json:"offset"` 22 | } 23 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/TemperatureDataResponse.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | // FullStateResponse contains informantion about the current state of the printer. 4 | type TemperatureDataResponse struct { 5 | // TemperatureStateResponse is the printer’s temperature state data. 6 | TemperatureStateResponse TemperatureStateResponse `json:"temperature"` 7 | 8 | // SD is the printer’s sd state data. 9 | // SD SDState `json:"sd"` 10 | 11 | // State is the printer’s general state. 12 | // State PrinterState `json:"state"` 13 | } 14 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/TemperaturePreset.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | // TemperaturePreset describes the temperature preset for a given material. 5 | type TemperaturePreset struct { 6 | Name string `json:"name"` 7 | Bed float64 `json:"bed"` 8 | Extruder float64 `json:"extruder"` 9 | } 10 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/TerminalFilter.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | // TerminalFilter to display in the terminal tab for filtering certain lines 5 | // from the display terminal log. 6 | type TerminalFilter struct { 7 | Name string `json:"name"` 8 | RegEx string `json:"regex"` 9 | } 10 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/VersionResponse.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | 5 | // VersionResponse is the response from a job command. 6 | type VersionResponse struct { 7 | // API is the API version. 8 | API string `json:"api"` 9 | 10 | // Server is the server version. 11 | Server string `json:"server"` 12 | } 13 | -------------------------------------------------------------------------------- /octoprintApis/dataModels/ZOffsetResponse.go: -------------------------------------------------------------------------------- 1 | package dataModels 2 | 3 | 4 | type ZOffsetResponse struct { 5 | // Job contains information regarding the target of the current print job. 6 | Offset float64 `json:"offset"` 7 | } 8 | -------------------------------------------------------------------------------- /octoprintApis/job.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | // "bytes" 5 | // "encoding/json" 6 | // "io" 7 | ) 8 | 9 | 10 | // https://docs.octoprint.org/en/master/api/job.html 11 | const JobApiUri = "/api/job" 12 | 13 | 14 | var JobToolErrors = StatusMapping { 15 | 409: "Printer is not operational or the current print job state does not match the preconditions for the command.", 16 | } 17 | -------------------------------------------------------------------------------- /octoprintApis/settings.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 7 | ) 8 | 9 | 10 | const SettingsApiUri = "/api/settings" 11 | 12 | 13 | // SettingsRequest retrieves the current configuration of OctoPrint. 14 | type SettingsRequest struct{} 15 | 16 | // Do sends an API request and returns the API response. 17 | func (cmd *SettingsRequest) Do(c *Client) (*dataModels.SettingsResponse, error) { 18 | bytes, err := c.doJsonRequest("GET", SettingsApiUri, nil, nil, true) 19 | if err != nil { 20 | return nil, err 21 | } 22 | 23 | response := &dataModels.SettingsResponse{} 24 | if err := json.Unmarshal(bytes, response); err != nil { 25 | return nil, err 26 | } 27 | 28 | return response, err 29 | } 30 | -------------------------------------------------------------------------------- /octoprintApis/system_test.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | /* 4 | import ( 5 | "testing" 6 | 7 | "github.com/stretchr/testify/assert" 8 | ) 9 | 10 | func TestSystemCommandsRequest_Do(t *testing.T) { 11 | cli := NewClient("http://localhost:5000", "") 12 | 13 | r := &SystemCommandsRequest{} 14 | state, err := r.Do(cli) 15 | assert.NoError(t, err) 16 | 17 | assert.Len(t, state.Core, 1) 18 | assert.Len(t, state.Custom, 0) 19 | assert.Equal(t, "shutdown", state.Core[0].Action) 20 | } 21 | 22 | func TestSystemExecuteCommandRequest_Do(t *testing.T) { 23 | cli := NewClient("http://localhost:5000", "") 24 | 25 | r := &SystemExecuteCommandRequest{} 26 | err := r.Do(cli) 27 | assert.Error(t, err) 28 | 29 | r = &SystemExecuteCommandRequest{Source: Core, Action: "shutdown"} 30 | err = r.Do(cli) 31 | assert.NoError(t, err) 32 | } 33 | */ -------------------------------------------------------------------------------- /octoprintApis/version.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 7 | ) 8 | 9 | 10 | const VersionApiUri = "/api/version" 11 | 12 | 13 | // VersionRequest retrieve information regarding server and API version. 14 | type VersionRequest struct{} 15 | 16 | // Do sends an API request and returns the API response. 17 | func (cmd *VersionRequest) Do(c *Client) (*dataModels.VersionResponse, error) { 18 | bytes, err := c.doJsonRequest("GET", VersionApiUri, nil, nil, true) 19 | if err != nil { 20 | return nil, err 21 | } 22 | 23 | response := &dataModels.VersionResponse{} 24 | if err := json.Unmarshal(bytes, response); err != nil { 25 | return nil, err 26 | } 27 | 28 | return response, err 29 | } 30 | -------------------------------------------------------------------------------- /octoprintApis/zbolt.go: -------------------------------------------------------------------------------- 1 | package octoprintApis 2 | 3 | import ( 4 | // "bytes" 5 | // "encoding/json" 6 | // "fmt" 7 | ) 8 | 9 | 10 | const PluginZBoltApiUri = "/api/plugin/zbolt" 11 | const PluginZBoltOctoScreenApiUri = "/api/plugin/zbolt_octoscreen" 12 | -------------------------------------------------------------------------------- /styles/z-bolt/images/blank.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /styles/z-bolt/images/logos/logo-octoprint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/styles/z-bolt/images/logos/logo-octoprint.png -------------------------------------------------------------------------------- /styles/z-bolt/images/logos/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/styles/z-bolt/images/logos/logo.png -------------------------------------------------------------------------------- /styles/z-bolt/images/logos/octoscreen-isometric-90%.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/styles/z-bolt/images/logos/octoscreen-isometric-90%.png -------------------------------------------------------------------------------- /styles/z-bolt/images/logos/octoscreen-isometric.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/styles/z-bolt/images/logos/octoscreen-isometric.png -------------------------------------------------------------------------------- /styles/z-bolt/images/logos/puzzle-piece.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/styles/z-bolt/images/logos/puzzle-piece.png -------------------------------------------------------------------------------- /ui/CustomItemsPanel.go: -------------------------------------------------------------------------------- 1 | package ui 2 | 3 | import ( 4 | // "github.com/Z-Bolt/OctoScreen/interfaces" 5 | // "github.com/Z-Bolt/OctoScreen/octoprintApis" 6 | "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 7 | // "github.com/Z-Bolt/OctoScreen/uiWidgets" 8 | ) 9 | 10 | 11 | type customItemsPanel struct { 12 | CommonPanel 13 | items []dataModels.MenuItem 14 | } 15 | 16 | func CustomItemsPanel( 17 | ui *UI, 18 | items []dataModels.MenuItem, 19 | ) *customItemsPanel { 20 | instance := &customItemsPanel { 21 | CommonPanel: NewCommonPanel("CustomItemsPanel", ui), 22 | items: items, 23 | } 24 | instance.initialize() 25 | 26 | return instance 27 | } 28 | 29 | func (this *customItemsPanel) initialize() { 30 | defer this.Initialize() 31 | this.arrangeMenuItems(this.grid, this.items, 4) 32 | } 33 | -------------------------------------------------------------------------------- /uiWidgets/NotificationsHook.go: -------------------------------------------------------------------------------- 1 | package uiWidgets 2 | 3 | import ( 4 | // "fmt" 5 | "time" 6 | 7 | "github.com/sirupsen/logrus" 8 | ) 9 | 10 | type NotificationsHook struct { 11 | notificationsBox *NotificationsBox 12 | } 13 | 14 | func NewNotificationsHook(notificationsBox *NotificationsBox) *NotificationsHook { 15 | return &NotificationsHook { 16 | notificationsBox: notificationsBox, 17 | } 18 | } 19 | 20 | func (this NotificationsHook) Levels() []logrus.Level { 21 | return []logrus.Level{ 22 | logrus.PanicLevel, 23 | logrus.FatalLevel, 24 | logrus.ErrorLevel, 25 | logrus.WarnLevel, 26 | } 27 | } 28 | 29 | func (this NotificationsHook) Fire(entry *logrus.Entry) error { 30 | d := 10 * time.Second 31 | if entry.Level == logrus.WarnLevel { 32 | d = time.Second 33 | } 34 | 35 | this.notificationsBox.Show(entry.Level.String(), entry.Message, d) 36 | 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /uiWidgets/ToolPrintingButon.go: -------------------------------------------------------------------------------- 1 | package uiWidgets 2 | 3 | import ( 4 | "github.com/gotk3/gotk3/gtk" 5 | "github.com/Z-Bolt/OctoScreen/utils" 6 | ) 7 | 8 | type ToolPrintingButton struct { 9 | *gtk.Button 10 | } 11 | 12 | func CreateToolPrintingButton( 13 | index int, 14 | ) *ToolPrintingButton { 15 | imageFileName := ToolImageFileName(index) 16 | instance := &ToolPrintingButton{ 17 | Button: utils.MustButtonImage("", imageFileName, nil), 18 | } 19 | 20 | ctx, _ := instance.GetStyleContext() 21 | ctx.AddClass("printing-state") 22 | 23 | return instance 24 | } 25 | -------------------------------------------------------------------------------- /utils/FileResponsesSortedByDate.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | // "fmt" 5 | // "sort" 6 | 7 | // "github.com/Z-Bolt/OctoScreen/octoprintApis" 8 | "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 9 | // "github.com/Z-Bolt/OctoScreen/uiWidgets" 10 | ) 11 | 12 | 13 | type FileResponsesSortedByDate []*dataModels.FileResponse 14 | 15 | func (this FileResponsesSortedByDate) Len() int { 16 | return len(this) 17 | } 18 | 19 | func (this FileResponsesSortedByDate) Swap(i, j int) { 20 | this[i], this[j] = this[j], this[i] 21 | } 22 | 23 | func (this FileResponsesSortedByDate) Less(i, j int) bool { 24 | return this[j].Date.Time.Before(this[i].Date.Time) 25 | } 26 | -------------------------------------------------------------------------------- /utils/FileResponsesSortedByName.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | // "fmt" 5 | // "sort" 6 | // "strings" 7 | 8 | // "github.com/Z-Bolt/OctoScreen/octoprintApis" 9 | "github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" 10 | // "github.com/Z-Bolt/OctoScreen/uiWidgets" 11 | ) 12 | 13 | 14 | type FileResponsesSortedByName []*dataModels.FileResponse 15 | 16 | func (this FileResponsesSortedByName) Len() int { 17 | return len(this) 18 | } 19 | 20 | func (this FileResponsesSortedByName) Swap(i, j int) { 21 | this[i], this[j] = this[j], this[i] 22 | } 23 | 24 | func (this FileResponsesSortedByName) Less(i, j int) bool { 25 | return this[j].Name > this[i].Name 26 | } 27 | -------------------------------------------------------------------------------- /utils/file_utils.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "os" 5 | // "strings" 6 | ) 7 | 8 | // FileExists checks if a file exists and is not a directory. 9 | // From https://golangcode.com/check-if-a-file-exists/ 10 | func FileExists(filename string) bool { 11 | info := exists(filename) 12 | if info == nil { 13 | return false 14 | } 15 | 16 | return !info.IsDir() 17 | } 18 | 19 | func FolderExists(filename string) bool { 20 | info := exists(filename) 21 | if info == nil { 22 | return false 23 | } 24 | 25 | return info.IsDir() 26 | } 27 | 28 | func exists(filename string) os.FileInfo { 29 | info, err := os.Stat(filename) 30 | if os.IsNotExist(err) { 31 | return nil 32 | } 33 | 34 | return info 35 | } 36 | -------------------------------------------------------------------------------- /utils/globalVars.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | 4 | var ( 5 | StylePath string 6 | WindowName = "OctoScreen" 7 | WindowWidth = 800 8 | WindowHeight = 480 9 | ) 10 | 11 | const ( 12 | ImageFolder = "images" 13 | CSSFilename = "style.css" 14 | ) 15 | -------------------------------------------------------------------------------- /utils/math_utils.go: -------------------------------------------------------------------------------- 1 | 2 | package utils 3 | 4 | import ( 5 | "math" 6 | ) 7 | 8 | func Round(num float64) int { 9 | return int(num + math.Copysign(0.5, num)) 10 | } 11 | 12 | func ToFixed(num float64, precision int) float64 { 13 | output := math.Pow(10, float64(precision)) 14 | return float64(Round(num * output)) / output 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/StackExchange/wmi/README.md: -------------------------------------------------------------------------------- 1 | wmi 2 | === 3 | 4 | Package wmi provides a WQL interface to Windows WMI. 5 | 6 | Note: It interfaces with WMI on the local machine, therefore it only runs on Windows. 7 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-systemd/Gopkg.toml: -------------------------------------------------------------------------------- 1 | [[constraint]] 2 | name = "github.com/coreos/pkg" 3 | version = "4.0.0" 4 | 5 | [[constraint]] 6 | name = "github.com/godbus/dbus" 7 | version = "5.0" 8 | 9 | [prune] 10 | go-tests = true 11 | unused-packages = true 12 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-systemd/NOTICE: -------------------------------------------------------------------------------- 1 | CoreOS Project 2 | Copyright 2018 CoreOS, Inc 3 | 4 | This product includes software developed at CoreOS, Inc. 5 | (http://www.coreos.com/). 6 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-systemd/examples/activation/httpserver/README.md: -------------------------------------------------------------------------------- 1 | ## socket activated http server 2 | 3 | This is a simple example of using socket activation with systemd to serve a 4 | simple HTTP server on http://127.0.0.1:8076 5 | 6 | To try it out `go get` the httpserver and run it under the systemd-activate helper 7 | 8 | ```bash 9 | export GOPATH="$PWD" 10 | go get github.com/coreos/go-systemd/examples/activation/httpserver 11 | systemd-socket-activate -l 127.0.0.1:8076 ./bin/httpserver 12 | ``` 13 | 14 | Then curl the URL and you will notice that it starts up: 15 | 16 | ``` 17 | curl 127.0.0.1:8076 18 | hello socket activated world! 19 | ``` 20 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-systemd/examples/activation/httpserver/hello.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Hello World HTTP 3 | Requires=network.target 4 | After=multi-user.target 5 | 6 | [Service] 7 | Type=simple 8 | ExecStart=/usr/local/bin/httpserver 9 | 10 | [Install] 11 | WantedBy=multi-user.target 12 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-systemd/examples/activation/httpserver/hello.socket: -------------------------------------------------------------------------------- 1 | [Socket] 2 | ListenStream=127.0.0.1:8076 3 | 4 | [Install] 5 | WantedBy=sockets.target 6 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-systemd/fixtures/enable-disable.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=enable disable test 3 | 4 | [Service] 5 | ExecStart=/bin/sleep 400 6 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-systemd/fixtures/image.raw.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/vendor/github.com/coreos/go-systemd/fixtures/image.raw.xz -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-systemd/fixtures/image.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/vendor/github.com/coreos/go-systemd/fixtures/image.tar.xz -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-systemd/fixtures/mask-unmask.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=mask unmask test 3 | 4 | [Service] 5 | ExecStart=/bin/sleep 400 6 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-systemd/fixtures/reload.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=reload test 3 | 4 | [Service] 5 | ExecStart=/bin/bash -c "trap '' HUP; /bin/sleep 400" 6 | ExecReload=-/bin/systemctl kill -s HUP reload.service 7 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-systemd/fixtures/start-failed.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=starting a failed test 3 | 4 | [Service] 5 | ExecStartPre=/bin/false 6 | ExecStart=/bin/sleep 400 7 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-systemd/fixtures/start-stop.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=start stop test 3 | 4 | [Service] 5 | ExecStart=/bin/sleep 400 6 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-systemd/fixtures/subscribe-events-set.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=start stop test 3 | 4 | [Service] 5 | ExecStart=/bin/sleep 400 6 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-systemd/fixtures/subscribe-events.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=start stop test 3 | 4 | [Service] 5 | ExecStart=/bin/sleep 400 6 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | go: 4 | - 1.3.x 5 | - 1.5.x 6 | - 1.6.x 7 | - 1.7.x 8 | - 1.8.x 9 | - 1.9.x 10 | - master 11 | matrix: 12 | allow_failures: 13 | - go: master 14 | fast_finish: true 15 | install: 16 | - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). 17 | script: 18 | - go get -t -v ./... 19 | - diff -u <(echo -n) <(gofmt -d -s .) 20 | - go tool vet . 21 | - go test -v -race ./... 22 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/big.go: -------------------------------------------------------------------------------- 1 | package humanize 2 | 3 | import ( 4 | "math/big" 5 | ) 6 | 7 | // order of magnitude (to a max order) 8 | func oomm(n, b *big.Int, maxmag int) (float64, int) { 9 | mag := 0 10 | m := &big.Int{} 11 | for n.Cmp(b) >= 0 { 12 | n.DivMod(n, b, m) 13 | mag++ 14 | if mag == maxmag && maxmag >= 0 { 15 | break 16 | } 17 | } 18 | return float64(n.Int64()) + (float64(m.Int64()) / float64(b.Int64())), mag 19 | } 20 | 21 | // total order of magnitude 22 | // (same as above, but with no upper limit) 23 | func oom(n, b *big.Int) (float64, int) { 24 | mag := 0 25 | m := &big.Int{} 26 | for n.Cmp(b) >= 0 { 27 | n.DivMod(n, b, m) 28 | mag++ 29 | } 30 | return float64(n.Int64()) + (float64(m.Int64()) / float64(b.Int64())), mag 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/common_test.go: -------------------------------------------------------------------------------- 1 | package humanize 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | type testList []struct { 8 | name, got, exp string 9 | } 10 | 11 | func (tl testList) validate(t *testing.T) { 12 | for _, test := range tl { 13 | if test.got != test.exp { 14 | t.Errorf("On %v, expected '%v', but got '%v'", 15 | test.name, test.exp, test.got) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/ftoa.go: -------------------------------------------------------------------------------- 1 | package humanize 2 | 3 | import "strconv" 4 | 5 | func stripTrailingZeros(s string) string { 6 | offset := len(s) - 1 7 | for offset > 0 { 8 | if s[offset] == '.' { 9 | offset-- 10 | break 11 | } 12 | if s[offset] != '0' { 13 | break 14 | } 15 | offset-- 16 | } 17 | return s[:offset+1] 18 | } 19 | 20 | // Ftoa converts a float to a string with no trailing zeros. 21 | func Ftoa(num float64) string { 22 | return stripTrailingZeros(strconv.FormatFloat(num, 'f', 6, 64)) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/humanize.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package humanize converts boring ugly numbers to human-friendly strings and back. 3 | 4 | Durations can be turned into strings such as "3 days ago", numbers 5 | representing sizes like 82854982 into useful strings like, "83 MB" or 6 | "79 MiB" (whichever you prefer). 7 | */ 8 | package humanize 9 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/ordinals.go: -------------------------------------------------------------------------------- 1 | package humanize 2 | 3 | import "strconv" 4 | 5 | // Ordinal gives you the input number in a rank/ordinal format. 6 | // 7 | // Ordinal(3) -> 3rd 8 | func Ordinal(x int) string { 9 | suffix := "th" 10 | switch x % 10 { 11 | case 1: 12 | if x%100 != 11 { 13 | suffix = "st" 14 | } 15 | case 2: 16 | if x%100 != 12 { 17 | suffix = "nd" 18 | } 19 | case 3: 20 | if x%100 != 13 { 21 | suffix = "rd" 22 | } 23 | } 24 | return strconv.Itoa(x) + suffix 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/ordinals_test.go: -------------------------------------------------------------------------------- 1 | package humanize 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestOrdinals(t *testing.T) { 8 | testList{ 9 | {"0", Ordinal(0), "0th"}, 10 | {"1", Ordinal(1), "1st"}, 11 | {"2", Ordinal(2), "2nd"}, 12 | {"3", Ordinal(3), "3rd"}, 13 | {"4", Ordinal(4), "4th"}, 14 | {"10", Ordinal(10), "10th"}, 15 | {"11", Ordinal(11), "11th"}, 16 | {"12", Ordinal(12), "12th"}, 17 | {"13", Ordinal(13), "13th"}, 18 | {"101", Ordinal(101), "101st"}, 19 | {"102", Ordinal(102), "102nd"}, 20 | {"103", Ordinal(103), "103rd"}, 21 | }.validate(t) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | 4 | go: 5 | - 1.1 6 | - 1.2 7 | - 1.3 8 | - 1.4 9 | - tip 10 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/_example/msagent/msagent.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package main 4 | 5 | import ( 6 | "time" 7 | 8 | ole "github.com/go-ole/go-ole" 9 | "github.com/go-ole/go-ole/oleutil" 10 | ) 11 | 12 | func main() { 13 | ole.CoInitialize(0) 14 | unknown, _ := oleutil.CreateObject("Agent.Control.1") 15 | agent, _ := unknown.QueryInterface(ole.IID_IDispatch) 16 | oleutil.PutProperty(agent, "Connected", true) 17 | characters := oleutil.MustGetProperty(agent, "Characters").ToIDispatch() 18 | oleutil.CallMethod(characters, "Load", "Merlin", "c:\\windows\\msagent\\chars\\Merlin.acs") 19 | character := oleutil.MustCallMethod(characters, "Character", "Merlin").ToIDispatch() 20 | oleutil.CallMethod(character, "Show") 21 | oleutil.CallMethod(character, "Speak", "こんにちわ世界") 22 | 23 | time.Sleep(4000000000) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/data/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/vendor/github.com/go-ole/go-ole/data/screenshot.png -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/error_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | // errstr converts error code to string. 6 | func errstr(errno int) string { 7 | return "" 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/error_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "fmt" 7 | "syscall" 8 | "unicode/utf16" 9 | ) 10 | 11 | // errstr converts error code to string. 12 | func errstr(errno int) string { 13 | // ask windows for the remaining errors 14 | var flags uint32 = syscall.FORMAT_MESSAGE_FROM_SYSTEM | syscall.FORMAT_MESSAGE_ARGUMENT_ARRAY | syscall.FORMAT_MESSAGE_IGNORE_INSERTS 15 | b := make([]uint16, 300) 16 | n, err := syscall.FormatMessage(flags, 0, uint32(errno), 0, b, nil) 17 | if err != nil { 18 | return fmt.Sprintf("error %d (FormatMessage failed with: %v)", errno, err) 19 | } 20 | // trim terminating \r and \n 21 | for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- { 22 | } 23 | return string(utf16.Decode(b[:n])) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/example/msagent/msagent.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package main 4 | 5 | import ( 6 | "time" 7 | 8 | ole "github.com/go-ole/go-ole" 9 | "github.com/go-ole/go-ole/oleutil" 10 | ) 11 | 12 | func main() { 13 | ole.CoInitialize(0) 14 | unknown, _ := oleutil.CreateObject("Agent.Control.1") 15 | agent, _ := unknown.QueryInterface(ole.IID_IDispatch) 16 | oleutil.PutProperty(agent, "Connected", true) 17 | characters := oleutil.MustGetProperty(agent, "Characters").ToIDispatch() 18 | oleutil.CallMethod(characters, "Load", "Merlin", "c:\\windows\\msagent\\chars\\Merlin.acs") 19 | character := oleutil.MustCallMethod(characters, "Character", "Merlin").ToIDispatch() 20 | oleutil.CallMethod(character, "Show") 21 | oleutil.CallMethod(character, "Speak", "こんにちわ世界") 22 | 23 | time.Sleep(4000000000) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpoint.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IConnectionPoint struct { 6 | IUnknown 7 | } 8 | 9 | type IConnectionPointVtbl struct { 10 | IUnknownVtbl 11 | GetConnectionInterface uintptr 12 | GetConnectionPointContainer uintptr 13 | Advise uintptr 14 | Unadvise uintptr 15 | EnumConnections uintptr 16 | } 17 | 18 | func (v *IConnectionPoint) VTable() *IConnectionPointVtbl { 19 | return (*IConnectionPointVtbl)(unsafe.Pointer(v.RawVTable)) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | import "unsafe" 6 | 7 | func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 { 8 | return int32(0) 9 | } 10 | 11 | func (v *IConnectionPoint) Advise(unknown *IUnknown) (uint32, error) { 12 | return uint32(0), NewError(E_NOTIMPL) 13 | } 14 | 15 | func (v *IConnectionPoint) Unadvise(cookie uint32) error { 16 | return NewError(E_NOTIMPL) 17 | } 18 | 19 | func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) (err error) { 20 | return NewError(E_NOTIMPL) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IConnectionPointContainer struct { 6 | IUnknown 7 | } 8 | 9 | type IConnectionPointContainerVtbl struct { 10 | IUnknownVtbl 11 | EnumConnectionPoints uintptr 12 | FindConnectionPoint uintptr 13 | } 14 | 15 | func (v *IConnectionPointContainer) VTable() *IConnectionPointContainerVtbl { 16 | return (*IConnectionPointContainerVtbl)(unsafe.Pointer(v.RawVTable)) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error { 6 | return NewError(E_NOTIMPL) 7 | } 8 | 9 | func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) error { 10 | return NewError(E_NOTIMPL) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error { 11 | return NewError(E_NOTIMPL) 12 | } 13 | 14 | func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) (err error) { 15 | hr, _, _ := syscall.Syscall( 16 | v.VTable().FindConnectionPoint, 17 | 3, 18 | uintptr(unsafe.Pointer(v)), 19 | uintptr(unsafe.Pointer(iid)), 20 | uintptr(unsafe.Pointer(point))) 21 | if hr != 0 { 22 | err = NewError(hr) 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/idispatch_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func getIDsOfName(disp *IDispatch, names []string) ([]int32, error) { 6 | return []int32{}, NewError(E_NOTIMPL) 7 | } 8 | 9 | func getTypeInfoCount(disp *IDispatch) (uint32, error) { 10 | return uint32(0), NewError(E_NOTIMPL) 11 | } 12 | 13 | func getTypeInfo(disp *IDispatch) (*ITypeInfo, error) { 14 | return nil, NewError(E_NOTIMPL) 15 | } 16 | 17 | func invoke(disp *IDispatch, dispid int32, dispatch int16, params ...interface{}) (*VARIANT, error) { 18 | return nil, NewError(E_NOTIMPL) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/ienumvariant.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IEnumVARIANT struct { 6 | IUnknown 7 | } 8 | 9 | type IEnumVARIANTVtbl struct { 10 | IUnknownVtbl 11 | Next uintptr 12 | Skip uintptr 13 | Reset uintptr 14 | Clone uintptr 15 | } 16 | 17 | func (v *IEnumVARIANT) VTable() *IEnumVARIANTVtbl { 18 | return (*IEnumVARIANTVtbl)(unsafe.Pointer(v.RawVTable)) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/ienumvariant_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (enum *IEnumVARIANT) Clone() (*IEnumVARIANT, error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | 9 | func (enum *IEnumVARIANT) Reset() error { 10 | return NewError(E_NOTIMPL) 11 | } 12 | 13 | func (enum *IEnumVARIANT) Skip(celt uint) error { 14 | return NewError(E_NOTIMPL) 15 | } 16 | 17 | func (enum *IEnumVARIANT) Next(celt uint) (VARIANT, uint, error) { 18 | return NewVariant(VT_NULL, int64(0)), 0, NewError(E_NOTIMPL) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iinspectable.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IInspectable struct { 6 | IUnknown 7 | } 8 | 9 | type IInspectableVtbl struct { 10 | IUnknownVtbl 11 | GetIIds uintptr 12 | GetRuntimeClassName uintptr 13 | GetTrustLevel uintptr 14 | } 15 | 16 | func (v *IInspectable) VTable() *IInspectableVtbl { 17 | return (*IInspectableVtbl)(unsafe.Pointer(v.RawVTable)) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iinspectable_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *IInspectable) GetIids() ([]*GUID, error) { 6 | return []*GUID{}, NewError(E_NOTIMPL) 7 | } 8 | 9 | func (v *IInspectable) GetRuntimeClassName() (string, error) { 10 | return "", NewError(E_NOTIMPL) 11 | } 12 | 13 | func (v *IInspectable) GetTrustLevel() (uint32, error) { 14 | return uint32(0), NewError(E_NOTIMPL) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IProvideClassInfo struct { 6 | IUnknown 7 | } 8 | 9 | type IProvideClassInfoVtbl struct { 10 | IUnknownVtbl 11 | GetClassInfo uintptr 12 | } 13 | 14 | func (v *IProvideClassInfo) VTable() *IProvideClassInfoVtbl { 15 | return (*IProvideClassInfoVtbl)(unsafe.Pointer(v.RawVTable)) 16 | } 17 | 18 | func (v *IProvideClassInfo) GetClassInfo() (cinfo *ITypeInfo, err error) { 19 | cinfo, err = getClassInfo(v) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) { 11 | hr, _, _ := syscall.Syscall( 12 | disp.VTable().GetClassInfo, 13 | 2, 14 | uintptr(unsafe.Pointer(disp)), 15 | uintptr(unsafe.Pointer(&tinfo)), 16 | 0) 17 | if hr != 0 { 18 | err = NewError(hr) 19 | } 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *ITypeInfo) GetTypeAttr() (*TYPEATTR, error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func (v *ITypeInfo) GetTypeAttr() (tattr *TYPEATTR, err error) { 11 | hr, _, _ := syscall.Syscall( 12 | uintptr(v.VTable().GetTypeAttr), 13 | 2, 14 | uintptr(unsafe.Pointer(v)), 15 | uintptr(unsafe.Pointer(&tattr)), 16 | 0) 17 | if hr != 0 { 18 | err = NewError(hr) 19 | } 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iunknown_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func reflectQueryInterface(self interface{}, method uintptr, interfaceID *GUID, obj interface{}) (err error) { 6 | return NewError(E_NOTIMPL) 7 | } 8 | 9 | func queryInterface(unk *IUnknown, iid *GUID) (disp *IDispatch, err error) { 10 | return nil, NewError(E_NOTIMPL) 11 | } 12 | 13 | func addRef(unk *IUnknown) int32 { 14 | return 0 15 | } 16 | 17 | func release(unk *IUnknown) int32 { 18 | return 0 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iunknown_windows_test.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import "testing" 6 | 7 | func TestIUnknown(t *testing.T) { 8 | defer func() { 9 | if r := recover(); r != nil { 10 | t.Error(r) 11 | } 12 | }() 13 | 14 | var err error 15 | 16 | err = CoInitialize(0) 17 | if err != nil { 18 | t.Fatal(err) 19 | } 20 | 21 | defer CoUninitialize() 22 | 23 | var unknown *IUnknown 24 | 25 | // oleutil.CreateObject() 26 | unknown, err = CreateInstance(CLSID_COMEchoTestObject, IID_IUnknown) 27 | if err != nil { 28 | t.Fatal(err) 29 | return 30 | } 31 | unknown.Release() 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/oleutil/connection_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package oleutil 4 | 5 | import ole "github.com/go-ole/go-ole" 6 | 7 | // ConnectObject creates a connection point between two services for communication. 8 | func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}) (uint32, error) { 9 | return 0, ole.NewError(ole.E_NOTIMPL) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/oleutil/go-get.go: -------------------------------------------------------------------------------- 1 | // This file is here so go get succeeds as without it errors with: 2 | // no buildable Go source files in ... 3 | // 4 | // +build !windows 5 | 6 | package oleutil 7 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/safearray.go: -------------------------------------------------------------------------------- 1 | // Package is meant to retrieve and process safe array data returned from COM. 2 | 3 | package ole 4 | 5 | // SafeArrayBound defines the SafeArray boundaries. 6 | type SafeArrayBound struct { 7 | Elements uint32 8 | LowerBound int32 9 | } 10 | 11 | // SafeArray is how COM handles arrays. 12 | type SafeArray struct { 13 | Dimensions uint16 14 | FeaturesFlag uint16 15 | ElementsSize uint32 16 | LocksAmount uint32 17 | Data uint32 18 | Bounds [16]byte 19 | } 20 | 21 | // SAFEARRAY is obsolete, exists for backwards compatibility. 22 | // Use SafeArray 23 | type SAFEARRAY SafeArray 24 | 25 | // SAFEARRAYBOUND is obsolete, exists for backwards compatibility. 26 | // Use SafeArrayBound 27 | type SAFEARRAYBOUND SafeArrayBound 28 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/safearrayslices.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | func safeArrayFromByteSlice(slice []byte) *SafeArray { 10 | array, _ := safeArrayCreateVector(VT_UI1, 0, uint32(len(slice))) 11 | 12 | if array == nil { 13 | panic("Could not convert []byte to SAFEARRAY") 14 | } 15 | 16 | for i, v := range slice { 17 | safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(&v))) 18 | } 19 | return array 20 | } 21 | 22 | func safeArrayFromStringSlice(slice []string) *SafeArray { 23 | array, _ := safeArrayCreateVector(VT_BSTR, 0, uint32(len(slice))) 24 | 25 | if array == nil { 26 | panic("Could not convert []string to SAFEARRAY") 27 | } 28 | // SysAllocStringLen(s) 29 | for i, v := range slice { 30 | safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(SysAllocStringLen(v)))) 31 | } 32 | return array 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variables.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | var ( 10 | modcombase = syscall.NewLazyDLL("combase.dll") 11 | modkernel32, _ = syscall.LoadDLL("kernel32.dll") 12 | modole32, _ = syscall.LoadDLL("ole32.dll") 13 | modoleaut32, _ = syscall.LoadDLL("oleaut32.dll") 14 | modmsvcrt, _ = syscall.LoadDLL("msvcrt.dll") 15 | moduser32, _ = syscall.LoadDLL("user32.dll") 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_386.go: -------------------------------------------------------------------------------- 1 | // +build 386 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_amd64.go: -------------------------------------------------------------------------------- 1 | // +build amd64 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | _ [8]byte // 24 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/golang-collections/collections/collections.go: -------------------------------------------------------------------------------- 1 | package collections 2 | 3 | type ( 4 | Collection interface { 5 | Do(func(interface{})bool) 6 | } 7 | ) 8 | 9 | func GetRange(c Collection, start, length int) []interface{} { 10 | end := start + length 11 | items := make([]interface{}, length) 12 | i := 0 13 | j := 0 14 | c.Do(func(item interface{})bool{ 15 | if i >= start { 16 | if i < end { 17 | items[j] = item 18 | j++ 19 | } else { 20 | return false 21 | } 22 | } 23 | i++ 24 | return true 25 | }) 26 | return items[:j] 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/golang-collections/collections/point.go: -------------------------------------------------------------------------------- 1 | package collections 2 | 3 | type ( 4 | Point struct { 5 | X, Y int 6 | } 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/golang-collections/collections/splay/splay_test.go: -------------------------------------------------------------------------------- 1 | package splay 2 | 3 | import ( 4 | //"fmt" 5 | "testing" 6 | ) 7 | 8 | func Test(t *testing.T) { 9 | tree := New(func(a,b interface{})bool { 10 | return a.(string) < b.(string) 11 | }) 12 | 13 | tree.Insert("d", 4) 14 | tree.Insert("b", 2) 15 | tree.Insert("a", 1) 16 | tree.Insert("c", 3) 17 | 18 | if tree.Len() != 4 { 19 | t.Errorf("expecting len 4") 20 | } 21 | 22 | tree.Remove("b") 23 | 24 | if tree.Len() != 3 { 25 | t.Errorf("expecting len 3") 26 | } 27 | } -------------------------------------------------------------------------------- /vendor/github.com/golang-collections/collections/stack/stack_test.go: -------------------------------------------------------------------------------- 1 | package stack 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func Test(t *testing.T) { 8 | s := New() 9 | 10 | if s.Len() != 0 { 11 | t.Errorf("Length of an empty stack should be 0") 12 | } 13 | 14 | s.Push(1) 15 | 16 | if s.Len() != 1 { 17 | t.Errorf("Length should be 0") 18 | } 19 | 20 | if s.Peek().(int) != 1 { 21 | t.Errorf("Top item on the stack should be 1") 22 | } 23 | 24 | if s.Pop().(int) != 1 { 25 | t.Errorf("Top item should have been 1") 26 | } 27 | 28 | if s.Len() != 0 { 29 | t.Errorf("Stack should be empty") 30 | } 31 | 32 | s.Push(1) 33 | s.Push(2) 34 | 35 | if s.Len() != 2 { 36 | t.Errorf("Length should be 2") 37 | } 38 | 39 | if s.Peek().(int) != 2 { 40 | t.Errorf("Top of the stack should be 2") 41 | } 42 | } -------------------------------------------------------------------------------- /vendor/github.com/golang-collections/collections/trie/trie_test.go: -------------------------------------------------------------------------------- 1 | package trie 2 | 3 | import ( 4 | //"fmt" 5 | "testing" 6 | ) 7 | 8 | func Test(t *testing.T) { 9 | x := New() 10 | x.Insert(1, 100) 11 | if x.Len() != 1 { 12 | t.Errorf("expected len 1") 13 | } 14 | if x.Get(1).(int) != 100 { 15 | t.Errorf("expected to get 100 for 1") 16 | } 17 | x.Remove(1) 18 | if x.Len() != 0 { 19 | t.Errorf("expected len 0") 20 | } 21 | x.Insert(2, 200) 22 | x.Insert(1, 100) 23 | vs := make([]int, 0) 24 | x.Do(func(k, v interface{}) bool { 25 | vs = append(vs, k.(int)) 26 | return true 27 | }) 28 | if len(vs) != 2 || vs[0] != 1 || vs[1] != 2 { 29 | t.Errorf("expected in order traversal") 30 | } 31 | } -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/CONTRIBUTIONS.md: -------------------------------------------------------------------------------- 1 | ## CONTRIBUTIONS 2 | - [conformal](https://github.com/conformal/gotk3) 3 | - [jrick](https://github.com/jrick/gotk3) 4 | - [sqp](https://github.com/sqp/gotk3) 5 | - [dradtke](https://github.com/dradtke/gotk3) 6 | - [MovingtoMars](https://github.com/MovingtoMars/gotk3) 7 | - [shish](https://github.com/shish/gotk3) 8 | - [andre](https://github.com/andre-hub/gotk3) 9 | - [raichu](https://github.com/raichu/gotk3) 10 | - [juniorz](https://github.com/juniorz) 11 | - you? -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2014 Conformal Systems LLC. 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any 4 | purpose with or without fee is hereby granted, provided that the above 5 | copyright notice and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/cairo/errors.go: -------------------------------------------------------------------------------- 1 | package cairo 2 | 3 | type ErrorStatus Status 4 | 5 | func (e ErrorStatus) Error() string { 6 | return StatusToString(Status(e)) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/cairo/fillrule.go: -------------------------------------------------------------------------------- 1 | package cairo 2 | 3 | // #cgo pkg-config: cairo cairo-gobject 4 | // #include 5 | // #include 6 | // #include 7 | import "C" 8 | import ( 9 | "unsafe" 10 | ) 11 | 12 | // FillRule is a representation of Cairo's cairo_fill_rule_t. 13 | type FillRule int 14 | 15 | const ( 16 | FILL_RULE_WINDING FillRule = C.CAIRO_FILL_RULE_WINDING 17 | FILL_RULE_EVEN_ODD FillRule = C.CAIRO_FILL_RULE_EVEN_ODD 18 | ) 19 | 20 | func marshalFillRule(p uintptr) (interface{}, error) { 21 | c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) 22 | return FillRule(c), nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/cairo/format.go: -------------------------------------------------------------------------------- 1 | package cairo 2 | 3 | // #cgo pkg-config: cairo cairo-gobject 4 | // #include 5 | // #include 6 | // #include 7 | import "C" 8 | import ( 9 | "unsafe" 10 | ) 11 | 12 | // Format is a representation of Cairo's cairo_format_t. 13 | type Format int 14 | 15 | const ( 16 | FORMAT_INVALID Format = C.CAIRO_FORMAT_INVALID 17 | FORMAT_ARGB32 Format = C.CAIRO_FORMAT_ARGB32 18 | FORMAT_RGB24 Format = C.CAIRO_FORMAT_RGB24 19 | FORMAT_A8 Format = C.CAIRO_FORMAT_A8 20 | FORMAT_A1 Format = C.CAIRO_FORMAT_A1 21 | FORMAT_RGB16_565 Format = C.CAIRO_FORMAT_RGB16_565 22 | FORMAT_RGB30 Format = C.CAIRO_FORMAT_RGB30 23 | ) 24 | 25 | func marshalFormat(p uintptr) (interface{}, error) { 26 | c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) 27 | return Format(c), nil 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/cairo/linecap.go: -------------------------------------------------------------------------------- 1 | package cairo 2 | 3 | // #cgo pkg-config: cairo cairo-gobject 4 | // #include 5 | // #include 6 | // #include 7 | import "C" 8 | import ( 9 | "unsafe" 10 | ) 11 | 12 | // LineCap is a representation of Cairo's cairo_line_cap_t. 13 | type LineCap int 14 | 15 | const ( 16 | LINE_CAP_BUTT LineCap = C.CAIRO_LINE_CAP_BUTT 17 | LINE_CAP_ROUND LineCap = C.CAIRO_LINE_CAP_ROUND 18 | LINE_CAP_SQUARE LineCap = C.CAIRO_LINE_CAP_SQUARE 19 | ) 20 | 21 | func marshalLineCap(p uintptr) (interface{}, error) { 22 | c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) 23 | return LineCap(c), nil 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/cairo/linejoin.go: -------------------------------------------------------------------------------- 1 | package cairo 2 | 3 | // #cgo pkg-config: cairo cairo-gobject 4 | // #include 5 | // #include 6 | // #include 7 | import "C" 8 | import ( 9 | "unsafe" 10 | ) 11 | 12 | // LineJoin is a representation of Cairo's cairo_line_join_t. 13 | type LineJoin int 14 | 15 | const ( 16 | LINE_JOIN_MITER LineJoin = C.CAIRO_LINE_JOIN_MITER 17 | LINE_JOIN_ROUND LineJoin = C.CAIRO_LINE_JOIN_ROUND 18 | LINE_JOIN_BEVEL LineJoin = C.CAIRO_LINE_JOIN_BEVEL 19 | ) 20 | 21 | func marshalLineJoin(p uintptr) (interface{}, error) { 22 | c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) 23 | return LineJoin(c), nil 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/cairo/mimetype.go: -------------------------------------------------------------------------------- 1 | package cairo 2 | 3 | // MimeType is a representation of Cairo's CAIRO_MIME_TYPE_* 4 | // preprocessor constants. 5 | type MimeType string 6 | 7 | const ( 8 | MIME_TYPE_JP2 MimeType = "image/jp2" 9 | MIME_TYPE_JPEG MimeType = "image/jpeg" 10 | MIME_TYPE_PNG MimeType = "image/png" 11 | MIME_TYPE_URI MimeType = "image/x-uri" 12 | MIME_TYPE_UNIQUE_ID MimeType = "application/x-cairo.uuid" 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/cairo/util.go: -------------------------------------------------------------------------------- 1 | package cairo 2 | 3 | // #cgo pkg-config: cairo cairo-gobject 4 | // #include 5 | // #include 6 | // #include 7 | import "C" 8 | 9 | func cairobool(b bool) C.cairo_bool_t { 10 | if b { 11 | return C.cairo_bool_t(1) 12 | } 13 | return C.cairo_bool_t(0) 14 | } 15 | 16 | func gobool(b C.cairo_bool_t) bool { 17 | if b != 0 { 18 | return true 19 | } 20 | return false 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_16.go: -------------------------------------------------------------------------------- 1 | //+build gtk_3_6 gtk_3_8 gtk_3_10 gtk_3_12 gtk_3_14 2 | 3 | package gdk 4 | 5 | // #cgo pkg-config: gdk-3.0 6 | // #include 7 | import "C" 8 | 9 | // SupportsComposite() is a wrapper around gdk_display_supports_composite(). 10 | func (v *Display) SupportsComposite() bool { 11 | c := C.gdk_display_supports_composite(v.native()) 12 | return gobool(c) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/gdk/window_no_x11.go: -------------------------------------------------------------------------------- 1 | // +build !linux no_x11 2 | 3 | package gdk 4 | 5 | func (v *Window) MoveToCurrentDesktop() { 6 | } 7 | 8 | // GetDesktop is a wrapper around gdk_x11_window_get_desktop(). 9 | // It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false 10 | func (v *Window) GetDesktop() uint32 { 11 | return 0 12 | } 13 | 14 | // MoveToDesktop is a wrapper around gdk_x11_window_move_to_desktop(). 15 | // It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false 16 | func (v *Window) MoveToDesktop(d uint32) { 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/glib/glib_extension.go: -------------------------------------------------------------------------------- 1 | //glib_extension contains definitions and functions to interface between glib/gtk/gio and go universe 2 | 3 | package glib 4 | 5 | import ( 6 | "reflect" 7 | ) 8 | 9 | // Should be implemented by any class which need special conversion like 10 | // gtk.Application -> gio.Application 11 | type IGlibConvert interface { 12 | // If convertion can't be done, function have to panic with a message that it can't convert to type 13 | Convert(reflect.Type) reflect.Value 14 | } 15 | 16 | var ( 17 | IGlibConvertType reflect.Type 18 | ) 19 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/glib/gmain_context.go: -------------------------------------------------------------------------------- 1 | package glib 2 | 3 | // #cgo pkg-config: glib-2.0 gobject-2.0 gio-2.0 4 | // #include 5 | // #include 6 | // #include 7 | // #include "glib.go.h" 8 | import "C" 9 | 10 | type MainContext C.GMainContext 11 | 12 | // native returns a pointer to the underlying GMainContext. 13 | func (v *MainContext) native() *C.GMainContext { 14 | if v == nil { 15 | return nil 16 | } 17 | return (*C.GMainContext)(v) 18 | } 19 | 20 | // MainContextDefault is a wrapper around g_main_context_default(). 21 | func MainContextDefault() *MainContext { 22 | c := C.g_main_context_default() 23 | if c == nil { 24 | return nil 25 | } 26 | return (*MainContext)(c) 27 | } 28 | 29 | // MainDepth is a wrapper around g_main_depth(). 30 | func MainDepth() int { 31 | return int(C.g_main_depth()) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/glib/gsource.go: -------------------------------------------------------------------------------- 1 | package glib 2 | 3 | // #cgo pkg-config: glib-2.0 gobject-2.0 gio-2.0 4 | // #include 5 | // #include 6 | // #include 7 | // #include "glib.go.h" 8 | import "C" 9 | 10 | type Source C.GSource 11 | 12 | // native returns a pointer to the underlying GSource. 13 | func (v *Source) native() *C.GSource { 14 | if v == nil { 15 | return nil 16 | } 17 | return (*C.GSource)(v) 18 | } 19 | 20 | // MainCurrentSource is a wrapper around g_main_current_source(). 21 | func MainCurrentSource() *Source { 22 | c := C.g_main_current_source() 23 | if c == nil { 24 | return nil 25 | } 26 | return (*Source)(c) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/glib/gvariant.go.h: -------------------------------------------------------------------------------- 1 | // Same copyright and license as the rest of the files in this project 2 | 3 | //GVariant : GVariant — strongly typed value datatype 4 | // https://developer.gnome.org/glib/2.26/glib-GVariant.html 5 | 6 | #ifndef __GVARIANT_GO_H__ 7 | #define __GVARIANT_GO_H__ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | // Type Casting 15 | 16 | static GVariant * 17 | toGVariant(void *p) 18 | { 19 | return (GVariant*)p; 20 | } 21 | 22 | static GVariantBuilder * 23 | toGVariantBuilder(void *p) 24 | { 25 | return (GVariantBuilder*)p; 26 | } 27 | 28 | static GVariantDict * 29 | toGVariantDict(void *p) 30 | { 31 | return (GVariantDict*)p; 32 | } 33 | 34 | static GVariantIter * 35 | toGVariantIter(void *p) 36 | { 37 | return (GVariantIter*)p; 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/glib/gvariant_test.go: -------------------------------------------------------------------------------- 1 | // Same copyright and license as the rest of the files in this project 2 | 3 | package glib_test 4 | 5 | import ( 6 | "testing" 7 | ) 8 | 9 | func Test_AcceleratorParse(t *testing.T) { 10 | /* 11 | testVariant := &Variant{} 12 | t.Log("native: " + testVariant.Native()) 13 | */ 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/gtk/accel_test.go: -------------------------------------------------------------------------------- 1 | // Same copyright and license as the rest of the files in this project 2 | 3 | package gtk 4 | 5 | import "testing" 6 | 7 | func Test_AccelGroup_Locking(t *testing.T) { 8 | ag, _ := AccelGroupNew() 9 | if ag.IsLocked() { 10 | t.Error("A newly created AccelGroup should not be locked") 11 | } 12 | 13 | ag.Lock() 14 | 15 | if !ag.IsLocked() { 16 | t.Error("A locked AccelGroup should report being locked") 17 | } 18 | 19 | ag.Unlock() 20 | 21 | if ag.IsLocked() { 22 | t.Error("An unlocked AccelGroup should report being unlocked") 23 | } 24 | } 25 | 26 | func Test_AcceleratorParse(t *testing.T) { 27 | l, r := AcceleratorParse("F1") 28 | if l != 65470 { 29 | t.Errorf("Expected parsed key to equal %d but was %d", 65470, l) 30 | } 31 | if r != 9 { 32 | t.Errorf("Expected parsed mods to equal %d but was %d", 9, r) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go.h: -------------------------------------------------------------------------------- 1 | 2 | static GtkStatusIcon * 3 | toGtkStatusIcon(void *p) 4 | { 5 | return (GTK_STATUS_ICON(p)); 6 | } 7 | 8 | /* 9 | * deprecated since version 3.14 10 | */ 11 | static GtkAlignment * 12 | toGtkAlignment(void *p) 13 | { 14 | return (GTK_ALIGNMENT(p)); 15 | } 16 | 17 | static GtkArrow * 18 | toGtkArrow(void *p) 19 | { 20 | return (GTK_ARROW(p)); 21 | } 22 | 23 | static GtkMisc * 24 | toGtkMisc(void *p) 25 | { 26 | return (GTK_MISC(p)); 27 | } 28 | /* 29 | * End deprecated since version 3.14 30 | */ 31 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/gtk/level_bar_since_3_8.go: -------------------------------------------------------------------------------- 1 | // +build !gtk_3_6 2 | 3 | package gtk 4 | 5 | // #include 6 | // #include "gtk.go.h" 7 | import "C" 8 | 9 | // SetInverted() is a wrapper around gtk_level_bar_set_inverted(). 10 | func (v *LevelBar) SetInverted(inverted bool) { 11 | C.gtk_level_bar_set_inverted(v.native(), gbool(inverted)) 12 | } 13 | 14 | // GetInverted() is a wrapper around gtk_level_bar_get_inverted(). 15 | func (v *LevelBar) GetInverted() bool { 16 | c := C.gtk_level_bar_get_inverted(v.native()) 17 | return gobool(c) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/gtk/menu_before_3_22.go: -------------------------------------------------------------------------------- 1 | // +build gtk_3_6 gtk_3_8 gtk_3_10 gtk_3_12 gtk_3_14 gtk_3_16 gtk_3_18 gtk_3_20 2 | 3 | package gtk 4 | 5 | // #cgo pkg-config: gtk+-3.0 6 | // #include 7 | // #include 8 | import "C" 9 | import "github.com/gotk3/gotk3/gdk" 10 | 11 | // PopupAtPointer() is a wrapper for gtk_menu_popup_at_pointer(), on older versions it uses PopupAtMouseCursor 12 | func (v *Menu) PopupAtPointer(_ *gdk.Event) { 13 | C.gtk_menu_popup(v.native(), 14 | nil, 15 | nil, 16 | nil, 17 | nil, 18 | C.guint(0), 19 | C.gtk_get_current_event_time()) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/gtk/menu_since_3_22.go: -------------------------------------------------------------------------------- 1 | // +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!gtk_3_16,!gtk_3_18,!gtk_3_20 2 | 3 | package gtk 4 | 5 | // #cgo pkg-config: gtk+-3.0 6 | // #include 7 | // #include 8 | import "C" 9 | import ( 10 | "unsafe" 11 | 12 | "github.com/gotk3/gotk3/gdk" 13 | ) 14 | 15 | // PopupAtPointer() is a wrapper for gtk_menu_popup_at_pointer(), on older versions it uses PopupAtMouseCursor 16 | func (v *Menu) PopupAtPointer(triggerEvent *gdk.Event) { 17 | e := (*C.GdkEvent)(unsafe.Pointer(triggerEvent.Native())) 18 | C.gtk_menu_popup_at_pointer(v.native(), e) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/gtk/settings.go.h: -------------------------------------------------------------------------------- 1 | static GtkSettings * 2 | toGtkSettings(void *p) 3 | { 4 | return (GTK_SETTINGS(p)); 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/gtk/text_mark.go: -------------------------------------------------------------------------------- 1 | // Same copyright and license as the rest of the files in this project 2 | 3 | package gtk 4 | 5 | // #include 6 | // #include "gtk.go.h" 7 | import "C" 8 | 9 | import "unsafe" 10 | 11 | /* 12 | * GtkTextMark 13 | */ 14 | 15 | // TextMark is a representation of GTK's GtkTextMark 16 | type TextMark C.GtkTextMark 17 | 18 | // native returns a pointer to the underlying GtkTextMark. 19 | func (v *TextMark) native() *C.GtkTextMark { 20 | if v == nil { 21 | return nil 22 | } 23 | return (*C.GtkTextMark)(v) 24 | } 25 | 26 | func marshalTextMark(p uintptr) (interface{}, error) { 27 | c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) 28 | return (*TextMark)(unsafe.Pointer(c)), nil 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/gtk/version.go: -------------------------------------------------------------------------------- 1 | package gtk 2 | 3 | // #cgo pkg-config: gtk+-3.0 4 | // #include 5 | import "C" 6 | import "errors" 7 | 8 | func CheckVersion(major, minor, micro uint) error { 9 | errChar := C.gtk_check_version(C.guint(major), C.guint(minor), C.guint(micro)) 10 | if errChar == nil { 11 | return nil 12 | } 13 | 14 | return errors.New(C.GoString((*C.char)(errChar))) 15 | } 16 | 17 | func GetMajorVersion() uint { 18 | v := C.gtk_get_major_version() 19 | return uint(v) 20 | } 21 | 22 | func GetMinorVersion() uint { 23 | v := C.gtk_get_minor_version() 24 | return uint(v) 25 | } 26 | 27 | func GetMicroVersion() uint { 28 | v := C.gtk_get_micro_version() 29 | return uint(v) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/gtk/version_test.go: -------------------------------------------------------------------------------- 1 | package gtk 2 | 3 | import "testing" 4 | 5 | func TestCheckVersion(t *testing.T) { 6 | err := CheckVersion(GetMajorVersion(), GetMinorVersion(), GetMicroVersion()) 7 | if err != nil { 8 | t.Error(err) 9 | } 10 | 11 | err = CheckVersion(GetMajorVersion(), GetMinorVersion(), GetMicroVersion()-1) 12 | if err != nil { 13 | t.Error(err) 14 | } 15 | 16 | err = CheckVersion(GetMajorVersion(), GetMinorVersion(), GetMicroVersion()+1) 17 | if err == nil { 18 | t.Error("Expected to fail when an more recent version is expected") 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/gtk/widget_since_3_14.go: -------------------------------------------------------------------------------- 1 | // +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12 2 | 3 | // See: https://developer.gnome.org/gtk3/3.14/api-index-3-14.html 4 | 5 | package gtk 6 | 7 | // #cgo pkg-config: gtk+-3.0 8 | // #include 9 | import "C" 10 | 11 | // GetClip is a wrapper around gtk_widget_get_clip(). 12 | func (v *Widget) GetClip() *Allocation { 13 | var clip Allocation 14 | C.gtk_widget_get_clip(v.native(), clip.native()) 15 | return &clip 16 | } 17 | 18 | // SetClip is a wrapper around gtk_widget_set_clip(). 19 | func (v *Widget) SetClip(clip *Allocation) { 20 | C.gtk_widget_set_clip(v.native(), clip.native()) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/gtk/window_since_3_10.go: -------------------------------------------------------------------------------- 1 | // Same copyright and license as the rest of the files in this project 2 | // This file contains accelerator related functions and structures 3 | 4 | // +build !gtk_3_6,!gtk_3_8 5 | // not use this: go build -tags gtk_3_8'. Otherwise, if no build tags are used, GTK 3.10 6 | 7 | package gtk 8 | 9 | // #cgo pkg-config: gtk+-3.0 10 | // #include 11 | // #include 12 | // #include "gtk_since_3_10.go.h" 13 | import "C" 14 | 15 | /* 16 | * GtkWindow 17 | */ 18 | 19 | // SetTitlebar is a wrapper around gtk_window_set_titlebar(). 20 | func (v *Window) SetTitlebar(titlebar IWidget) { 21 | C.gtk_window_set_titlebar(v.native(), titlebar.toWidget()) 22 | } 23 | 24 | // Close is a wrapper around gtk_window_close(). 25 | func (v *Window) Close() { 26 | C.gtk_window_close(v.native()) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/gtk/window_since_3_12.go: -------------------------------------------------------------------------------- 1 | // +build !gtk_3_6,!gtk_3_8,!gtk_3_10 2 | 3 | package gtk 4 | 5 | // #cgo pkg-config: gtk+-3.0 6 | // #include 7 | import "C" 8 | 9 | // IsMaximized is a wrapper around gtk_window_is_maximized(). 10 | func (v *Window) IsMaximized() bool { 11 | c := C.gtk_window_is_maximized(v.native()) 12 | return gobool(c) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/gotk3/gotk3/pango/pangocairo.go.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/vendor/github.com/gotk3/gotk3/pango/pangocairo.go.h -------------------------------------------------------------------------------- /vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/konsorten/go-windows-terminal-sequences 2 | -------------------------------------------------------------------------------- /vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin 2 | 3 | package sequences 4 | 5 | import ( 6 | "fmt" 7 | ) 8 | 9 | func EnableVirtualTerminalProcessing(stream uintptr, enable bool) error { 10 | return fmt.Errorf("windows only package") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/mcuadros/go-octoprint/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | sudo: required 4 | 5 | services: 6 | - docker 7 | 8 | go: 9 | - 1.9 10 | 11 | before_install: 12 | - docker run -d -p 5000:5000 -v $PWD/.travis/config.yaml:/home/octoprint/.octoprint/config.yaml --name octoprint octoprint/octoprint 13 | - sleep 5 14 | 15 | script: 16 | - go get -t -v ./... 17 | - go test -v ./... 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /vendor/github.com/mcuadros/go-octoprint/TemperatureData.go: -------------------------------------------------------------------------------- 1 | package octoprint 2 | 3 | import ( 4 | // "encoding/json" 5 | // "strconv" 6 | // "strings" 7 | // "time" 8 | ) 9 | 10 | // TemperatureData is temperature stats for a tool. 11 | type TemperatureData struct { 12 | // Actual current temperature. 13 | Actual float64 `json:"actual"` 14 | 15 | // Target temperature, may be nil if no target temperature is set. 16 | Target float64 `json:"target"` 17 | 18 | // Offset currently configured temperature offset to apply, will be left 19 | // out for historic temperature information. 20 | Offset float64 `json:"offset"` 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/mcuadros/go-octoprint/printerprofiles.go: -------------------------------------------------------------------------------- 1 | package octoprint 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | // SettingsRequest retrieves the current configuration of OctoPrint. 9 | type PrinterProfilesRequest struct { 10 | Id string 11 | } 12 | 13 | // Do sends an API request and returns the API response. 14 | func (cmd *PrinterProfilesRequest) Do(c *Client) (*PrinterProfile, error) { 15 | uri := fmt.Sprintf("/api/printerprofiles/%s", cmd.Id) 16 | b, err := c.doJSONRequest("GET", uri, nil, nil) 17 | if err != nil { 18 | return nil, err 19 | } 20 | 21 | r := &PrinterProfile{} 22 | if err := json.Unmarshal(b, r); err != nil { 23 | return nil, err 24 | } 25 | 26 | return r, err 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/mcuadros/go-octoprint/settings.go: -------------------------------------------------------------------------------- 1 | package octoprint 2 | 3 | import "encoding/json" 4 | 5 | const URISettings = "/api/settings" 6 | 7 | // SettingsRequest retrieves the current configuration of OctoPrint. 8 | type SettingsRequest struct{} 9 | 10 | // Do sends an API request and returns the API response. 11 | func (cmd *SettingsRequest) Do(c *Client) (*SettingsResponse, error) { 12 | bytes, err := c.doJSONRequest("GET", URISettings, nil, nil) 13 | if err != nil { 14 | return nil, err 15 | } 16 | 17 | response := &SettingsResponse{} 18 | if err := json.Unmarshal(bytes, response); err != nil { 19 | return nil, err 20 | } 21 | 22 | return response, err 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mcuadros/go-octoprint/settings_test.go: -------------------------------------------------------------------------------- 1 | package octoprint 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | ) 8 | 9 | func TestSettingsRequest_Do(t *testing.T) { 10 | cli := NewClient("http://localhost:5000", "") 11 | 12 | r := &SettingsRequest{} 13 | settings, err := r.Do(cli) 14 | assert.NoError(t, err) 15 | 16 | assert.Equal(t, settings.API.Enabled, true) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/mcuadros/go-octoprint/system_test.go: -------------------------------------------------------------------------------- 1 | package octoprint 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | ) 8 | 9 | func TestSystemCommandsRequest_Do(t *testing.T) { 10 | cli := NewClient("http://localhost:5000", "") 11 | 12 | r := &SystemCommandsRequest{} 13 | state, err := r.Do(cli) 14 | assert.NoError(t, err) 15 | 16 | assert.Len(t, state.Core, 1) 17 | assert.Len(t, state.Custom, 0) 18 | assert.Equal(t, "shutdown", state.Core[0].Action) 19 | } 20 | 21 | func TestSystemExecuteCommandRequest_Do(t *testing.T) { 22 | cli := NewClient("http://localhost:5000", "") 23 | 24 | r := &SystemExecuteCommandRequest{} 25 | err := r.Do(cli) 26 | assert.Error(t, err) 27 | 28 | r = &SystemExecuteCommandRequest{Source: Core, Action: "shutdown"} 29 | err = r.Do(cli) 30 | assert.NoError(t, err) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/mcuadros/go-octoprint/version.go: -------------------------------------------------------------------------------- 1 | package octoprint 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | const URIVersion = "/api/version" 8 | 9 | // VersionRequest retrieve information regarding server and API version. 10 | type VersionRequest struct{} 11 | 12 | // Do sends an API request and returns the API response. 13 | func (cmd *VersionRequest) Do(c *Client) (*VersionResponse, error) { 14 | b, err := c.doJSONRequest("GET", URIVersion, nil, nil) 15 | if err != nil { 16 | return nil, err 17 | } 18 | 19 | r := &VersionResponse{} 20 | if err := json.Unmarshal(b, r); err != nil { 21 | return nil, err 22 | } 23 | 24 | return r, err 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | test: 4 | docker: 5 | - image: circleci/golang:1.9 6 | working_directory: /home/circleci/go/src/github.com/shirou/gopsutil 7 | environment: 8 | GOPATH: /home/circleci/go 9 | steps: 10 | - run: 11 | command: | 12 | echo -e 'export PATH=$GOPATH/bin:$PATH' >> $BASH_ENV 13 | source /home/circleci/.bashrc 14 | - checkout 15 | - run: 16 | command: make init_tools 17 | - run: 18 | command: dep ensure 19 | - run: 20 | command: go build -v 21 | - run: 22 | command: make build_test 23 | 24 | workflows: 25 | version: 2 26 | test: 27 | jobs: 28 | - test 29 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for gopsutil 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | [A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]] 9 | 10 | **Describe the solution you'd like** 11 | [A clear and concise description of what you want to happen.] 12 | 13 | **Describe alternatives you've considered** 14 | [A clear and concise description of any alternative solutions or features you've considered.] 15 | 16 | **Additional context** 17 | [Add any other context or screenshots about the feature request here.] 18 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | #* 3 | _obj 4 | *.tmp 5 | .idea 6 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | timezone: 3 | Asia/Tokyo 4 | pre: 5 | - sudo chown -R ubuntu:ubuntu /usr/local/go/pkg/ 6 | test: 7 | override: 8 | - GOOS=linux GOARCH=amd64 go test -v ./... 9 | - GOOS=linux GOARCH=386 go get -v ./... 10 | - GOOS=linux GOARCH=arm GOARM=7 go get -v ./... 11 | - GOOS=freebsd GOARCH=amd64 go get -v ./... 12 | - GOOS=windows GOARCH=amd64 go get -v ./... 13 | - GOOS=darwin GOARCH=amd64 go get -v ./... 14 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/coverall.sh: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | 3 | # see http://www.songmu.jp/riji/entry/2015-01-15-goveralls-multi-package.html 4 | 5 | set -e 6 | # cleanup 7 | cleanup() { 8 | if [ $tmpprof != "" ] && [ -f $tmpprof ]; then 9 | rm -f $tmpprof 10 | fi 11 | exit 12 | } 13 | trap cleanup INT QUIT TERM EXIT 14 | 15 | # メインの処理 16 | prof=${1:-".profile.cov"} 17 | echo "mode: count" > $prof 18 | gopath1=$(echo $GOPATH | cut -d: -f1) 19 | for pkg in $(go list ./...); do 20 | tmpprof=$gopath1/src/$pkg/profile.tmp 21 | go test -covermode=count -coverprofile=$tmpprof $pkg 22 | if [ -f $tmpprof ]; then 23 | cat $tmpprof | tail -n +2 >> $prof 24 | rm $tmpprof 25 | fi 26 | done 27 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_nocgo.go: -------------------------------------------------------------------------------- 1 | // +build darwin 2 | // +build !cgo 3 | 4 | package cpu 5 | 6 | import "github.com/shirou/gopsutil/internal/common" 7 | 8 | func perCPUTimes() ([]TimesStat, error) { 9 | return []TimesStat{}, common.ErrNotImplementedError 10 | } 11 | 12 | func allCPUTimes() ([]TimesStat, error) { 13 | return []TimesStat{}, common.ErrNotImplementedError 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/cpu_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows 2 | 3 | package cpu 4 | 5 | import ( 6 | "github.com/shirou/gopsutil/internal/common" 7 | ) 8 | 9 | func Times(percpu bool) ([]TimesStat, error) { 10 | return []TimesStat{}, common.ErrNotImplementedError 11 | } 12 | 13 | func Info() ([]InfoStat, error) { 14 | return []InfoStat{}, common.ErrNotImplementedError 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd_386.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint32 5 | Nice uint32 6 | Sys uint32 7 | Intr uint32 8 | Idle uint32 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Intr uint64 8 | Idle uint64 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/testdata/linux/times_empty/proc/stat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/vendor/github.com/shirou/gopsutil/cpu/testdata/linux/times_empty/proc/stat -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/testdata/solaris/1cpu_1core_isainfo.txt: -------------------------------------------------------------------------------- 1 | 64-bit amd64 applications 2 | rdseed adx avx2 fma bmi2 bmi1 rdrand f16c vmx avx xsave pclmulqdq 3 | aes movbe sse4.2 sse4.1 ssse3 popcnt tscp cx16 sse3 sse2 sse fxsr 4 | mmx cmov amd_sysc cx8 tsc fpu -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/testdata/solaris/1cpu_1core_psrinfo.txt: -------------------------------------------------------------------------------- 1 | The physical processor has 1 virtual processor (0) 2 | x86 (GenuineIntel 406E3 family 6 model 78 step 3 clock 3312 MHz) 3 | Intel(r) Core(tm) i7-6567U CPU @ 3.30GHz -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/testdata/solaris/2cpu_1core_isainfo.txt: -------------------------------------------------------------------------------- 1 | 64-bit amd64 applications 2 | rdseed adx avx2 fma bmi2 bmi1 rdrand f16c vmx avx xsave pclmulqdq 3 | aes movbe sse4.2 sse4.1 ssse3 popcnt tscp cx16 sse3 sse2 sse fxsr 4 | mmx cmov amd_sysc cx8 tsc fpu -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/testdata/solaris/2cpu_1core_psrinfo.txt: -------------------------------------------------------------------------------- 1 | The physical processor has 1 virtual processor (0) 2 | x86 (GenuineIntel 406E3 family 6 model 78 step 3 clock 3312 MHz) 3 | Intel(r) Core(tm) i7-6567U CPU @ 3.30GHz 4 | The physical processor has 1 virtual processor (1) 5 | x86 (GenuineIntel 406E3 family 6 model 78 step 3 clock 3312 MHz) 6 | Intel(r) Core(tm) i7-6567U CPU @ 3.30GHz -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/testdata/solaris/2cpu_8core_isainfo.txt: -------------------------------------------------------------------------------- 1 | 64-bit amd64 applications 2 | vmx avx xsave pclmulqdq aes sse4.2 sse4.1 ssse3 popcnt tscp cx16 3 | sse3 sse2 sse fxsr mmx cmov amd_sysc cx8 tsc fpu -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/disk/disk_darwin_nocgo.go: -------------------------------------------------------------------------------- 1 | // +build darwin 2 | // +build !cgo 3 | 4 | package disk 5 | 6 | import "github.com/shirou/gopsutil/internal/common" 7 | 8 | func IOCounters(names ...string) (map[string]IOCountersStat, error) { 9 | return nil, common.ErrNotImplementedError 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/disk/disk_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!openbsd,!windows,!solaris 2 | 3 | package disk 4 | 5 | import "github.com/shirou/gopsutil/internal/common" 6 | 7 | func IOCounters(names ...string) (map[string]IOCountersStat, error) { 8 | return nil, common.ErrNotImplementedError 9 | } 10 | 11 | func Partitions(all bool) ([]PartitionStat, error) { 12 | return []PartitionStat{}, common.ErrNotImplementedError 13 | } 14 | 15 | func Usage(path string) (*UsageStat, error) { 16 | return nil, common.ErrNotImplementedError 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/doc.go: -------------------------------------------------------------------------------- 1 | package gopsutil 2 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_darwin_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_darwin.go 3 | 4 | package host 5 | 6 | type Utmpx struct { 7 | User [256]int8 8 | ID [4]int8 9 | Line [32]int8 10 | Pid int32 11 | Type int16 12 | Pad_cgo_0 [6]byte 13 | Tv Timeval 14 | Host [256]int8 15 | Pad [16]uint32 16 | } 17 | type Timeval struct { 18 | Sec int32 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_darwin.go 3 | 4 | package host 5 | 6 | type Utmpx struct { 7 | User [256]int8 8 | ID [4]int8 9 | Line [32]int8 10 | Pid int32 11 | Type int16 12 | Pad_cgo_0 [6]byte 13 | Tv Timeval 14 | Host [256]int8 15 | Pad [16]uint32 16 | } 17 | type Timeval struct { 18 | Sec int32 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_darwin_nocgo.go: -------------------------------------------------------------------------------- 1 | // +build darwin 2 | // +build !cgo 3 | 4 | package host 5 | 6 | import "github.com/shirou/gopsutil/internal/common" 7 | 8 | func SensorsTemperatures() ([]TemperatureStat, error) { 9 | return []TemperatureStat{}, common.ErrNotImplementedError 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows 2 | 3 | package host 4 | 5 | import "github.com/shirou/gopsutil/internal/common" 6 | 7 | func Info() (*InfoStat, error) { 8 | return nil, common.ErrNotImplementedError 9 | } 10 | 11 | func BootTime() (uint64, error) { 12 | return 0, common.ErrNotImplementedError 13 | } 14 | 15 | func Uptime() (uint64, error) { 16 | return 0, common.ErrNotImplementedError 17 | } 18 | 19 | func Users() ([]UserStat, error) { 20 | return []UserStat{}, common.ErrNotImplementedError 21 | } 22 | 23 | func Virtualization() (string, string, error) { 24 | return "", "", common.ErrNotImplementedError 25 | } 26 | 27 | func KernelVersion() (string, error) { 28 | return "", common.ErrNotImplementedError 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_freebsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmpx = 197 // TODO why should 197 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [16]int8 25 | Host [16]int8 26 | Time int32 27 | } 28 | 29 | type Utmpx struct { 30 | Type int16 31 | Tv Timeval 32 | Id [8]int8 33 | Pid int32 34 | User [32]int8 35 | Line [16]int8 36 | Host [125]int8 37 | // X__ut_spare [64]int8 38 | } 39 | 40 | type Timeval struct { 41 | Sec [4]byte 42 | Usec [3]byte 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_freebsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x8 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmpx = 197 // TODO: why should 197, not 0x118 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int64 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [16]int8 25 | Host [16]int8 26 | Time int32 27 | } 28 | 29 | type Utmpx struct { 30 | Type int16 31 | Tv Timeval 32 | Id [8]int8 33 | Pid int32 34 | User [32]int8 35 | Line [16]int8 36 | Host [125]int8 37 | // Host [128]int8 38 | // X__ut_spare [64]int8 39 | } 40 | 41 | type Timeval struct { 42 | Sec [4]byte 43 | Usec [3]byte 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_freebsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmpx = 197 // TODO: why should 197, not 0x118 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [16]int8 25 | Host [16]int8 26 | Time int32 27 | } 28 | 29 | type Utmpx struct { 30 | Type int16 31 | Tv Timeval 32 | Id [8]int8 33 | Pid int32 34 | User [32]int8 35 | Line [16]int8 36 | Host [125]int8 37 | // Host [128]int8 38 | // X__ut_spare [64]int8 39 | } 40 | 41 | type Timeval struct { 42 | Sec [4]byte 43 | Usec [3]byte 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_openbsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x8 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x130 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int64 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [32]int8 25 | Host [256]int8 26 | Time int64 27 | } 28 | type Timeval struct { 29 | Sec int64 30 | Usec int64 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/types_darwin.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | // plus hand editing about timeval 3 | 4 | /* 5 | Input to cgo -godefs. 6 | */ 7 | 8 | package host 9 | 10 | /* 11 | #include 12 | #include 13 | */ 14 | import "C" 15 | 16 | type Utmpx C.struct_utmpx 17 | type Timeval C.struct_timeval 18 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/types_freebsd.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | /* 4 | Input to cgo -godefs. 5 | */ 6 | 7 | package host 8 | 9 | /* 10 | #define KERNEL 11 | #include 12 | #include 13 | #include 14 | 15 | enum { 16 | sizeofPtr = sizeof(void*), 17 | }; 18 | 19 | */ 20 | import "C" 21 | 22 | // Machine characteristics; for internal use. 23 | 24 | const ( 25 | sizeofPtr = C.sizeofPtr 26 | sizeofShort = C.sizeof_short 27 | sizeofInt = C.sizeof_int 28 | sizeofLong = C.sizeof_long 29 | sizeofLongLong = C.sizeof_longlong 30 | sizeOfUtmpx = C.sizeof_struct_utmpx 31 | ) 32 | 33 | // Basic types 34 | 35 | type ( 36 | _C_short C.short 37 | _C_int C.int 38 | _C_long C.long 39 | _C_long_long C.longlong 40 | ) 41 | 42 | type Utmp C.struct_utmp 43 | type Utmpx C.struct_utmpx 44 | type Timeval C.struct_timeval 45 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/types_linux.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | /* 4 | Input to cgo -godefs. 5 | */ 6 | 7 | package host 8 | 9 | /* 10 | #include 11 | #include 12 | 13 | enum { 14 | sizeofPtr = sizeof(void*), 15 | }; 16 | 17 | */ 18 | import "C" 19 | 20 | // Machine characteristics; for internal use. 21 | 22 | const ( 23 | sizeofPtr = C.sizeofPtr 24 | sizeofShort = C.sizeof_short 25 | sizeofInt = C.sizeof_int 26 | sizeofLong = C.sizeof_long 27 | sizeofLongLong = C.sizeof_longlong 28 | sizeOfUtmp = C.sizeof_struct_utmp 29 | ) 30 | 31 | // Basic types 32 | 33 | type ( 34 | _C_short C.short 35 | _C_int C.int 36 | _C_long C.long 37 | _C_long_long C.longlong 38 | ) 39 | 40 | type utmp C.struct_utmp 41 | type exit_status C.struct_exit_status 42 | type timeval C.struct_timeval 43 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/types_openbsd.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | /* 4 | Input to cgo -godefs. 5 | */ 6 | 7 | package host 8 | 9 | /* 10 | #define KERNEL 11 | #include 12 | #include 13 | #include 14 | 15 | enum { 16 | sizeofPtr = sizeof(void*), 17 | }; 18 | 19 | */ 20 | import "C" 21 | 22 | // Machine characteristics; for internal use. 23 | 24 | const ( 25 | sizeofPtr = C.sizeofPtr 26 | sizeofShort = C.sizeof_short 27 | sizeofInt = C.sizeof_int 28 | sizeofLong = C.sizeof_long 29 | sizeofLongLong = C.sizeof_longlong 30 | sizeOfUtmp = C.sizeof_struct_utmp 31 | ) 32 | 33 | // Basic types 34 | 35 | type ( 36 | _C_short C.short 37 | _C_int C.int 38 | _C_long C.long 39 | _C_long_long C.longlong 40 | ) 41 | 42 | type Utmp C.struct_utmp 43 | type Timeval C.struct_timeval 44 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/load/load.go: -------------------------------------------------------------------------------- 1 | package load 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/shirou/gopsutil/internal/common" 7 | ) 8 | 9 | var invoke common.Invoker 10 | 11 | func init() { 12 | invoke = common.Invoke{} 13 | } 14 | 15 | type AvgStat struct { 16 | Load1 float64 `json:"load1"` 17 | Load5 float64 `json:"load5"` 18 | Load15 float64 `json:"load15"` 19 | } 20 | 21 | func (l AvgStat) String() string { 22 | s, _ := json.Marshal(l) 23 | return string(s) 24 | } 25 | 26 | type MiscStat struct { 27 | ProcsRunning int `json:"procsRunning"` 28 | ProcsBlocked int `json:"procsBlocked"` 29 | Ctxt int `json:"ctxt"` 30 | } 31 | 32 | func (m MiscStat) String() string { 33 | s, _ := json.Marshal(m) 34 | return string(s) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/load/load_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!openbsd,!windows 2 | 3 | package load 4 | 5 | import "github.com/shirou/gopsutil/internal/common" 6 | 7 | func Avg() (*AvgStat, error) { 8 | return nil, common.ErrNotImplementedError 9 | } 10 | 11 | func Misc() (*MiscStat, error) { 12 | return nil, common.ErrNotImplementedError 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/load/load_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package load 4 | 5 | import ( 6 | "github.com/shirou/gopsutil/internal/common" 7 | ) 8 | 9 | func Avg() (*AvgStat, error) { 10 | ret := AvgStat{} 11 | 12 | return &ret, common.ErrNotImplementedError 13 | } 14 | 15 | func Misc() (*MiscStat, error) { 16 | ret := MiscStat{} 17 | 18 | return &ret, common.ErrNotImplementedError 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/mem/mem_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows 2 | 3 | package mem 4 | 5 | import "github.com/shirou/gopsutil/internal/common" 6 | 7 | func VirtualMemory() (*VirtualMemoryStat, error) { 8 | return nil, common.ErrNotImplementedError 9 | } 10 | 11 | func SwapMemory() (*SwapMemoryStat, error) { 12 | return nil, common.ErrNotImplementedError 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/mem/types_openbsd.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | /* 4 | Input to cgo -godefs. 5 | */ 6 | 7 | package mem 8 | 9 | /* 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | */ 16 | import "C" 17 | 18 | // Machine characteristics; for internal use. 19 | 20 | const ( 21 | CTLVm = 2 22 | CTLVfs = 10 23 | VmUvmexp = 4 // get uvmexp 24 | VfsGeneric = 0 25 | VfsBcacheStat = 3 26 | ) 27 | 28 | const ( 29 | sizeOfUvmexp = C.sizeof_struct_uvmexp 30 | sizeOfBcachestats = C.sizeof_struct_bcachestats 31 | ) 32 | 33 | type Uvmexp C.struct_uvmexp 34 | type Bcachestats C.struct_bcachestats 35 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/mktypes.sh: -------------------------------------------------------------------------------- 1 | 2 | DIRS="cpu disk docker host load mem net process" 3 | 4 | GOOS=`uname | tr '[:upper:]' '[:lower:]'` 5 | ARCH=`uname -m` 6 | 7 | case $ARCH in 8 | amd64) 9 | GOARCH="amd64" 10 | ;; 11 | x86_64) 12 | GOARCH="amd64" 13 | ;; 14 | i386) 15 | GOARCH="386" 16 | ;; 17 | i686) 18 | GOARCH="386" 19 | ;; 20 | arm) 21 | GOARCH="arm" 22 | ;; 23 | *) 24 | echo "unknown arch: $ARCH" 25 | exit 1 26 | esac 27 | 28 | for DIR in $DIRS 29 | do 30 | if [ -e ${DIR}/types_${GOOS}.go ]; then 31 | echo "// +build $GOOS" > ${DIR}/${DIR}_${GOOS}_${GOARCH}.go 32 | echo "// +build $GOARCH" >> ${DIR}/${DIR}_${GOOS}_${GOARCH}.go 33 | go tool cgo -godefs ${DIR}/types_${GOOS}.go >> ${DIR}/${DIR}_${GOOS}_${GOARCH}.go 34 | fi 35 | done 36 | 37 | 38 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/net/net_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!openbsd,!windows 2 | 3 | package net 4 | 5 | import "github.com/shirou/gopsutil/internal/common" 6 | 7 | func IOCounters(pernic bool) ([]IOCountersStat, error) { 8 | return []IOCountersStat{}, common.ErrNotImplementedError 9 | } 10 | 11 | func FilterCounters() ([]FilterStat, error) { 12 | return []FilterStat{}, common.ErrNotImplementedError 13 | } 14 | 15 | func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { 16 | return []ProtoCountersStat{}, common.ErrNotImplementedError 17 | } 18 | 19 | func Connections(kind string) ([]ConnectionStat, error) { 20 | return []ConnectionStat{}, common.ErrNotImplementedError 21 | } 22 | 23 | func ConnectionsMax(kind string, max int) ([]ConnectionStat, error) { 24 | return []ConnectionStat{}, common.ErrNotImplementedError 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/process/process_posix_test.go: -------------------------------------------------------------------------------- 1 | // +build linux freebsd 2 | 3 | package process 4 | 5 | import ( 6 | "os" 7 | "testing" 8 | 9 | "golang.org/x/sys/unix" 10 | ) 11 | 12 | func Test_SendSignal(t *testing.T) { 13 | checkPid := os.Getpid() 14 | 15 | p, _ := NewProcess(int32(checkPid)) 16 | err := p.SendSignal(unix.SIGCONT) 17 | if err != nil { 18 | t.Errorf("send signal %v", err) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/process/process_windows_386.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package process 4 | 5 | type PROCESS_MEMORY_COUNTERS struct { 6 | CB uint32 7 | PageFaultCount uint32 8 | PeakWorkingSetSize uint32 9 | WorkingSetSize uint32 10 | QuotaPeakPagedPoolUsage uint32 11 | QuotaPagedPoolUsage uint32 12 | QuotaPeakNonPagedPoolUsage uint32 13 | QuotaNonPagedPoolUsage uint32 14 | PagefileUsage uint32 15 | PeakPagefileUsage uint32 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/process/process_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package process 4 | 5 | type PROCESS_MEMORY_COUNTERS struct { 6 | CB uint32 7 | PageFaultCount uint32 8 | PeakWorkingSetSize uint64 9 | WorkingSetSize uint64 10 | QuotaPeakPagedPoolUsage uint64 11 | QuotaPagedPoolUsage uint64 12 | QuotaPeakNonPagedPoolUsage uint64 13 | QuotaNonPagedPoolUsage uint64 14 | PagefileUsage uint64 15 | PeakPagefileUsage uint64 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/process/testdata/darwin/ps-ax-opid_fail: -------------------------------------------------------------------------------- 1 | PID 2 | 245 3 | 247 4 | 248 5 | 249 6 | 254 7 | 262 8 | 264 9 | 265 10 | 267 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/windows_memo.rst: -------------------------------------------------------------------------------- 1 | Windows memo 2 | ===================== 3 | 4 | Size 5 | ---------- 6 | 7 | DWORD 8 | 32-bit unsigned integer 9 | DWORDLONG 10 | 64-bit unsigned integer 11 | DWORD_PTR 12 | unsigned long type for pointer precision 13 | DWORD32 14 | 32-bit unsigned integer 15 | DWORD64 16 | 64-bit unsigned integer 17 | HALF_PTR 18 | _WIN64 = int, else short 19 | INT 20 | 32-bit signed integer 21 | INT_PTR 22 | _WIN64 = __int64 else int 23 | LONG 24 | 32-bit signed integer 25 | LONGLONG 26 | 64-bit signed integer 27 | LONG_PTR 28 | _WIN64 = __int64 else long 29 | SHORT 30 | 16-bit integer 31 | SIZE_T 32 | maximum number of bytes to which a pointer can point. typedef ULONG_PTR SIZE_T; 33 | SSIZE_T 34 | signed version of SIZE_T. typedef LONG_PTR SSIZE_T; 35 | WORD 36 | 16-bit unsigned integer -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/winservices/manager.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package winservices 4 | 5 | import ( 6 | "golang.org/x/sys/windows/svc/mgr" 7 | ) 8 | 9 | type scmanager struct { 10 | mgr *mgr.Mgr 11 | } 12 | 13 | func openSCManager() (*scmanager, error) { 14 | m, err := mgr.Connect() 15 | if err != nil { 16 | return nil, err 17 | } 18 | return &scmanager{m}, nil 19 | } 20 | 21 | func (sc *scmanager) close() error { 22 | return sc.mgr.Disconnect() 23 | } 24 | 25 | func getService(serviceName string) (*mgr.Service, error) { 26 | m, err := openSCManager() 27 | if err != nil { 28 | return nil, err 29 | } 30 | defer m.close() 31 | return m.mgr.OpenService(serviceName) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/.gitignore: -------------------------------------------------------------------------------- 1 | logrus 2 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.6.x 4 | - 1.7.x 5 | - 1.8.x 6 | - tip 7 | env: 8 | - GOMAXPROCS=4 GORACE=halt_on_error=1 9 | install: 10 | - go get github.com/stretchr/testify/assert 11 | - go get gopkg.in/gemnasium/logrus-airbrake-hook.v2 12 | - go get golang.org/x/sys/unix 13 | - go get golang.org/x/sys/windows 14 | script: 15 | - go test -race -v ./... 16 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{build}" 2 | platform: x64 3 | clone_folder: c:\gopath\src\github.com\sirupsen\logrus 4 | environment: 5 | GOPATH: c:\gopath 6 | branches: 7 | only: 8 | - master 9 | install: 10 | - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% 11 | - go version 12 | build_script: 13 | - go get -t 14 | - go test 15 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/hooks/syslog/syslog_test.go: -------------------------------------------------------------------------------- 1 | package syslog 2 | 3 | import ( 4 | "log/syslog" 5 | "testing" 6 | 7 | "github.com/sirupsen/logrus" 8 | ) 9 | 10 | func TestLocalhostAddAndPrint(t *testing.T) { 11 | log := logrus.New() 12 | hook, err := NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") 13 | 14 | if err != nil { 15 | t.Errorf("Unable to connect to local syslog.") 16 | } 17 | 18 | log.Hooks.Add(hook) 19 | 20 | for _, level := range hook.Levels() { 21 | if len(log.Hooks[level]) != 1 { 22 | t.Errorf("SyslogHook was not added. The length of log.Hooks[%v]: %v", level, len(log.Hooks[level])) 23 | } 24 | } 25 | 26 | log.Info("Congratulations!") 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package logrus 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | const ioctlReadTermios = unix.TIOCGETA 9 | 10 | type Termios unix.Termios 11 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | ) 8 | 9 | func checkIfTerminal(w io.Writer) bool { 10 | return true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | 9 | "golang.org/x/crypto/ssh/terminal" 10 | ) 11 | 12 | func checkIfTerminal(w io.Writer) bool { 13 | switch v := w.(type) { 14 | case *os.File: 15 | return terminal.IsTerminal(int(v.Fd())) 16 | default: 17 | return false 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine 7 | 8 | package logrus 9 | 10 | import "golang.org/x/sys/unix" 11 | 12 | const ioctlReadTermios = unix.TCGETS 13 | 14 | type Termios unix.Termios 15 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/travis/cross_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$TRAVIS_GO_VERSION" =~ ^1.\12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then 4 | /tmp/gox/gox -build-lib -all 5 | fi 6 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/travis/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [[ "$TRAVIS_GO_VERSION" =~ ^1.\12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then 6 | git clone https://github.com/dgsb/gox.git /tmp/gox 7 | pushd /tmp/gox 8 | git checkout new_master 9 | go build ./ 10 | popd 11 | fi 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in this repo as binary, with no git magic updating 2 | # line endings. Windows users contributing to Go will need to use a 3 | # modern version of git and editors capable of LF line endings. 4 | # 5 | # We'll prevent accidental CRLF line endings from entering the repo 6 | # via the git-review gofmt checks. 7 | # 8 | # See golang.org/issue/9281 9 | 10 | * -text 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/.gitignore: -------------------------------------------------------------------------------- 1 | # Add no patterns to .hgignore except for files generated by the build. 2 | last-change 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at https://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at https://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/README.md: -------------------------------------------------------------------------------- 1 | # Go Cryptography 2 | 3 | This repository holds supplementary Go cryptography libraries. 4 | 5 | ## Download/Install 6 | 7 | The easiest way to install is to run `go get -u golang.org/x/crypto/...`. You 8 | can also manually git clone the repository to `$GOPATH/src/golang.org/x/crypto`. 9 | 10 | ## Report Issues / Send Patches 11 | 12 | This repository uses Gerrit for code changes. To learn how to submit changes to 13 | this repository, see https://golang.org/doc/contribute.html. 14 | 15 | The main issue tracker for the crypto repository is located at 16 | https://github.com/golang/go/issues. Prefix your issue with "x/crypto:" in the 17 | subject line, so it is easy to find. 18 | 19 | Note that contributions to the cryptography package receive additional scrutiny 20 | due to their sensitive nature. Patches may take longer than normal to receive 21 | feedback. 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/argon2/blamka_ref.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64 appengine gccgo 6 | 7 | package argon2 8 | 9 | func processBlock(out, in1, in2 *block) { 10 | processBlockGeneric(out, in1, in2, false) 11 | } 12 | 13 | func processBlockXOR(out, in1, in2 *block) { 14 | processBlockGeneric(out, in1, in2, true) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.7,amd64,!gccgo,!appengine 6 | 7 | package blake2b 8 | 9 | func init() { 10 | useSSE4 = supportsSSE4() 11 | } 12 | 13 | //go:noescape 14 | func supportsSSE4() bool 15 | 16 | //go:noescape 17 | func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) 18 | 19 | func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { 20 | if useSSE4 { 21 | hashBlocksSSE4(h, c, flag, blocks) 22 | } else { 23 | hashBlocksGeneric(h, c, flag, blocks) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2b/blake2b_ref.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64 appengine gccgo 6 | 7 | package blake2b 8 | 9 | func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { 10 | hashBlocksGeneric(h, c, flag, blocks) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2b/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package blake2b 8 | 9 | import ( 10 | "crypto" 11 | "hash" 12 | ) 13 | 14 | func init() { 15 | newHash256 := func() hash.Hash { 16 | h, _ := New256(nil) 17 | return h 18 | } 19 | newHash384 := func() hash.Hash { 20 | h, _ := New384(nil) 21 | return h 22 | } 23 | 24 | newHash512 := func() hash.Hash { 25 | h, _ := New512(nil) 26 | return h 27 | } 28 | 29 | crypto.RegisterHash(crypto.BLAKE2b_256, newHash256) 30 | crypto.RegisterHash(crypto.BLAKE2b_384, newHash384) 31 | crypto.RegisterHash(crypto.BLAKE2b_512, newHash512) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2s/blake2s_ref.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64,!386 gccgo appengine 6 | 7 | package blake2s 8 | 9 | var ( 10 | useSSE4 = false 11 | useSSSE3 = false 12 | useSSE2 = false 13 | ) 14 | 15 | func hashBlocks(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) { 16 | hashBlocksGeneric(h, c, flag, blocks) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2s/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package blake2s 8 | 9 | import ( 10 | "crypto" 11 | "hash" 12 | ) 13 | 14 | func init() { 15 | newHash256 := func() hash.Hash { 16 | h, _ := New256(nil) 17 | return h 18 | } 19 | 20 | crypto.RegisterHash(crypto.BLAKE2s_256, newHash256) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64 !go1.7 gccgo appengine 6 | 7 | package chacha20poly1305 8 | 9 | func (c *chacha20poly1305) seal(dst, nonce, plaintext, additionalData []byte) []byte { 10 | return c.sealGeneric(dst, nonce, plaintext, additionalData) 11 | } 12 | 13 | func (c *chacha20poly1305) open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) { 14 | return c.openGeneric(dst, nonce, ciphertext, additionalData) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/const_amd64.h: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This code was translated into a form compatible with 6a from the public 6 | // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html 7 | 8 | #define REDMASK51 0x0007FFFFFFFFFFFF 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/const_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This code was translated into a form compatible with 6a from the public 6 | // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html 7 | 8 | // +build amd64,!gccgo,!appengine 9 | 10 | // These constants cannot be encoded in non-MOVQ immediates. 11 | // We access them directly from memory instead. 12 | 13 | DATA ·_121666_213(SB)/8, $996687872 14 | GLOBL ·_121666_213(SB), 8, $8 15 | 16 | DATA ·_2P0(SB)/8, $0xFFFFFFFFFFFDA 17 | GLOBL ·_2P0(SB), 8, $8 18 | 19 | DATA ·_2P1234(SB)/8, $0xFFFFFFFFFFFFE 20 | GLOBL ·_2P1234(SB), 8, $8 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ed25519/testdata/sign.input.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/vendor/golang.org/x/crypto/ed25519/testdata/sign.input.gz -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/md4/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package md4_test 6 | 7 | import ( 8 | "fmt" 9 | "io" 10 | 11 | "golang.org/x/crypto/md4" 12 | ) 13 | 14 | func ExampleNew() { 15 | h := md4.New() 16 | data := "These pretzels are making me thirsty." 17 | io.WriteString(h, data) 18 | fmt.Printf("%x", h.Sum(nil)) 19 | // Output: 48c4e365090b30a32f084c4888deceaa 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/pkcs12/errors.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package pkcs12 6 | 7 | import "errors" 8 | 9 | var ( 10 | // ErrDecryption represents a failure to decrypt the input. 11 | ErrDecryption = errors.New("pkcs12: decryption error, incorrect padding") 12 | 13 | // ErrIncorrectPassword is returned when an incorrect password is detected. 14 | // Usually, P12/PFX data is signed to be able to verify the password. 15 | ErrIncorrectPassword = errors.New("pkcs12: decryption password incorrect") 16 | ) 17 | 18 | // NotImplementedError indicates that the input is not currently supported. 19 | type NotImplementedError string 20 | 21 | func (e NotImplementedError) Error() string { 22 | return "pkcs12: " + string(e) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/pkcs12/internal/rc2/bench_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package rc2 6 | 7 | import ( 8 | "testing" 9 | ) 10 | 11 | func BenchmarkEncrypt(b *testing.B) { 12 | r, _ := New([]byte{0, 0, 0, 0, 0, 0, 0, 0}, 64) 13 | b.ResetTimer() 14 | var src [8]byte 15 | for i := 0; i < b.N; i++ { 16 | r.Encrypt(src[:], src[:]) 17 | } 18 | } 19 | 20 | func BenchmarkDecrypt(b *testing.B) { 21 | r, _ := New([]byte{0, 0, 0, 0, 0, 0, 0, 0}, 64) 22 | b.ResetTimer() 23 | var src [8]byte 24 | for i := 0; i < b.N; i++ { 25 | r.Decrypt(src[:], src[:]) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/poly1305/sum_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!gccgo,!appengine 6 | 7 | package poly1305 8 | 9 | // This function is implemented in sum_amd64.s 10 | //go:noescape 11 | func poly1305(out *[16]byte, m *byte, mlen uint64, key *[32]byte) 12 | 13 | // Sum generates an authenticator for m using a one-time key and puts the 14 | // 16-byte result into out. Authenticating two different messages with the same 15 | // key allows an attacker to forge messages at will. 16 | func Sum(out *[16]byte, m []byte, key *[32]byte) { 17 | var mPtr *byte 18 | if len(m) > 0 { 19 | mPtr = &m[0] 20 | } 21 | poly1305(out, mPtr, uint64(len(m)), key) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/poly1305/sum_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,!gccgo,!appengine,!nacl 6 | 7 | package poly1305 8 | 9 | // This function is implemented in sum_arm.s 10 | //go:noescape 11 | func poly1305_auth_armv6(out *[16]byte, m *byte, mlen uint32, key *[32]byte) 12 | 13 | // Sum generates an authenticator for m using a one-time key and puts the 14 | // 16-byte result into out. Authenticating two different messages with the same 15 | // key allows an attacker to forge messages at will. 16 | func Sum(out *[16]byte, m []byte, key *[32]byte) { 17 | var mPtr *byte 18 | if len(m) > 0 { 19 | mPtr = &m[0] 20 | } 21 | poly1305_auth_armv6(out, mPtr, uint32(len(m)), key) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!appengine,!gccgo 6 | 7 | package salsa 8 | 9 | // This function is implemented in salsa2020_amd64.s. 10 | 11 | //go:noescape 12 | 13 | func salsa2020XORKeyStream(out, in *byte, n uint64, nonce, key *byte) 14 | 15 | // XORKeyStream crypts bytes from in to out using the given key and counters. 16 | // In and out must overlap entirely or not at all. Counter 17 | // contains the raw salsa20 counter bytes (both nonce and block counter). 18 | func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { 19 | if len(in) == 0 { 20 | return 21 | } 22 | _ = out[len(in)-1] 23 | salsa2020XORKeyStream(&out[0], &in[0], uint64(len(in)), &counter[0], &key[0]) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/scrypt/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package scrypt_test 6 | 7 | import ( 8 | "encoding/base64" 9 | "fmt" 10 | "log" 11 | 12 | "golang.org/x/crypto/scrypt" 13 | ) 14 | 15 | func Example() { 16 | // DO NOT use this salt value; generate your own random salt. 8 bytes is 17 | // a good length. 18 | salt := []byte{0xc8, 0x28, 0xf2, 0x58, 0xa7, 0x6a, 0xad, 0x7b} 19 | 20 | dk, err := scrypt.Key([]byte("some password"), salt, 1<<15, 8, 1, 32) 21 | if err != nil { 22 | log.Fatal(err) 23 | } 24 | fmt.Println(base64.StdEncoding.EncodeToString(dk)) 25 | // Output: lGnMz8io0AUkfzn6Pls1qX20Vs7PGN6sbYQ2TQgY12M= 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/keccakf_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!appengine,!gccgo 6 | 7 | package sha3 8 | 9 | // This function is implemented in keccakf_amd64.s. 10 | 11 | //go:noescape 12 | 13 | func keccakF1600(a *[25]uint64) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package sha3 8 | 9 | import ( 10 | "crypto" 11 | ) 12 | 13 | func init() { 14 | crypto.RegisterHash(crypto.SHA3_224, New224) 15 | crypto.RegisterHash(crypto.SHA3_256, New256) 16 | crypto.RegisterHash(crypto.SHA3_384, New384) 17 | crypto.RegisterHash(crypto.SHA3_512, New512) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/testdata/keccakKats.json.deflate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Z-Bolt/OctoScreen/28ce7ba29fb8222991dbd66cff37d4e1290bc6a1/vendor/golang.org/x/crypto/sha3/testdata/keccakKats.json.deflate -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/xor.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64,!386,!ppc64le appengine 6 | 7 | package sha3 8 | 9 | var ( 10 | xorIn = xorInGeneric 11 | copyOut = copyOutGeneric 12 | xorInUnaligned = xorInGeneric 13 | copyOutUnaligned = copyOutGeneric 14 | ) 15 | 16 | const xorImplementationUnaligned = "generic" 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/xor_generic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package sha3 6 | 7 | import "encoding/binary" 8 | 9 | // xorInGeneric xors the bytes in buf into the state; it 10 | // makes no non-portable assumptions about memory layout 11 | // or alignment. 12 | func xorInGeneric(d *state, buf []byte) { 13 | n := len(buf) / 8 14 | 15 | for i := 0; i < n; i++ { 16 | a := binary.LittleEndian.Uint64(buf) 17 | d.a[i] ^= a 18 | buf = buf[8:] 19 | } 20 | } 21 | 22 | // copyOutGeneric copies ulint64s to a byte buffer. 23 | func copyOutGeneric(d *state, b []byte) { 24 | for i := 0; len(b) >= 8; i++ { 25 | binary.LittleEndian.PutUint64(b, d.a[i]) 26 | b = b[8:] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/tcpip_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ssh 6 | 7 | import ( 8 | "testing" 9 | ) 10 | 11 | func TestAutoPortListenBroken(t *testing.T) { 12 | broken := "SSH-2.0-OpenSSH_5.9hh11" 13 | works := "SSH-2.0-OpenSSH_6.1" 14 | if !isBrokenOpenSSHVersion(broken) { 15 | t.Errorf("version %q not marked as broken", broken) 16 | } 17 | if isBrokenOpenSSHVersion(works) { 18 | t.Errorf("version %q marked as broken", works) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package terminal 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ioctlReadTermios = unix.TIOCGETA 12 | const ioctlWriteTermios = unix.TIOCSETA 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package terminal 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | const ioctlReadTermios = unix.TCGETS 10 | const ioctlWriteTermios = unix.TCSETS 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/test/banner_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd 6 | 7 | package test 8 | 9 | import ( 10 | "testing" 11 | ) 12 | 13 | func TestBannerCallbackAgainstOpenSSH(t *testing.T) { 14 | server := newServer(t) 15 | defer server.Shutdown() 16 | 17 | clientConf := clientConfig() 18 | 19 | var receivedBanner string 20 | clientConf.BannerCallback = func(message string) error { 21 | receivedBanner = message 22 | return nil 23 | } 24 | 25 | conn := server.Dial(clientConf) 26 | defer conn.Close() 27 | 28 | expected := "Server Banner" 29 | if receivedBanner != expected { 30 | t.Fatalf("got %v; want %v", receivedBanner, expected) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/test/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package test contains integration tests for the 6 | // golang.org/x/crypto/ssh package. 7 | package test // import "golang.org/x/crypto/ssh/test" 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/testdata/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This package contains test data shared between the various subpackages of 6 | // the golang.org/x/crypto/ssh package. Under no circumstance should 7 | // this data be used for production code. 8 | package testdata // import "golang.org/x/crypto/ssh/testdata" 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in this repo as binary, with no git magic updating 2 | # line endings. Windows users contributing to Go will need to use a 3 | # modern version of git and editors capable of LF line endings. 4 | # 5 | # We'll prevent accidental CRLF line endings from entering the repo 6 | # via the git-review gofmt checks. 7 | # 8 | # See golang.org/issue/9281 9 | 10 | * -text 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/.gitignore: -------------------------------------------------------------------------------- 1 | # Add no patterns to .hgignore except for files generated by the build. 2 | last-change 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/README.md: -------------------------------------------------------------------------------- 1 | # sys 2 | 3 | This repository holds supplemental Go packages for low-level interactions with 4 | the operating system. 5 | 6 | ## Download/Install 7 | 8 | The easiest way to install is to run `go get -u golang.org/x/sys`. You can 9 | also manually git clone the repository to `$GOPATH/src/golang.org/x/sys`. 10 | 11 | ## Report Issues / Send Patches 12 | 13 | This repository uses Gerrit for code changes. To learn how to submit changes to 14 | this repository, see https://golang.org/doc/contribute.html. 15 | 16 | The main issue tracker for the sys repository is located at 17 | https://github.com/golang/go/issues. Prefix your issue with "x/sys:" in the 18 | subject line, so it is easy to find. 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/byteorder.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | import ( 8 | "encoding/binary" 9 | "runtime" 10 | ) 11 | 12 | // hostByteOrder returns binary.LittleEndian on little-endian machines and 13 | // binary.BigEndian on big-endian machines. 14 | func hostByteOrder() binary.ByteOrder { 15 | switch runtime.GOARCH { 16 | case "386", "amd64", "amd64p32", 17 | "arm", "arm64", 18 | "mipsle", "mips64le", "mips64p32le", 19 | "ppc64le", 20 | "riscv", "riscv64": 21 | return binary.LittleEndian 22 | case "armbe", "arm64be", 23 | "mips", "mips64", "mips64p32", 24 | "ppc", "ppc64", 25 | "s390", "s390x", 26 | "sparc", "sparc64": 27 | return binary.BigEndian 28 | } 29 | panic("unknown architecture") 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix,ppc64 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 128 10 | 11 | const ( 12 | // getsystemcfg constants 13 | _SC_IMPL = 2 14 | _IMPL_POWER8 = 0x10000 15 | _IMPL_POWER9 = 0x20000 16 | ) 17 | 18 | func init() { 19 | impl := getsystemcfg(_SC_IMPL) 20 | if impl&_IMPL_POWER8 != 0 { 21 | PPC64.IsPOWER8 = true 22 | } 23 | if impl&_IMPL_POWER9 != 0 { 24 | PPC64.IsPOWER9 = true 25 | } 26 | 27 | Initialized = true 28 | } 29 | 30 | func getsystemcfg(label int) (n uint64) { 31 | r0, _ := callgetsystemcfg(label) 32 | n = uint64(r0) 33 | return 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | const cacheLineSize = 32 8 | 9 | func doinit() {} 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | package cpu 8 | 9 | // haveAsmFunctions reports whether the other functions in this file can 10 | // be safely called. 11 | func haveAsmFunctions() bool { return true } 12 | 13 | // The following feature detection functions are defined in cpu_s390x.s. 14 | // They are likely to be expensive to call so the results should be cached. 15 | func stfle() facilityList 16 | func kmQuery() queryResult 17 | func kmcQuery() queryResult 18 | func kmctrQuery() queryResult 19 | func kmaQuery() queryResult 20 | func kimdQuery() queryResult 21 | func klmdQuery() queryResult 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gc_x86.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386 amd64 amd64p32 6 | // +build !gccgo 7 | 8 | package cpu 9 | 10 | // cpuid is implemented in cpu_x86.s for gc compiler 11 | // and in cpu_gccgo.c for gccgo. 12 | func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) 13 | 14 | // xgetbv with ecx = 0 is implemented in cpu_x86.s for gc compiler 15 | // and in cpu_gccgo.c for gccgo. 16 | func xgetbv() (eax, edx uint32) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gccgo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386 amd64 amd64p32 6 | // +build gccgo 7 | 8 | package cpu 9 | 10 | //extern gccgoGetCpuidCount 11 | func gccgoGetCpuidCount(eaxArg, ecxArg uint32, eax, ebx, ecx, edx *uint32) 12 | 13 | func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) { 14 | var a, b, c, d uint32 15 | gccgoGetCpuidCount(eaxArg, ecxArg, &a, &b, &c, &d) 16 | return a, b, c, d 17 | } 18 | 19 | //extern gccgoXgetbv 20 | func gccgoXgetbv(eax, edx *uint32) 21 | 22 | func xgetbv() (eax, edx uint32) { 23 | var a, d uint32 24 | gccgoXgetbv(&a, &d) 25 | return a, d 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_mips64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build mips64 mips64le 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 32 10 | 11 | func doinit() {} 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_mipsx.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build mips mipsle 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 32 10 | 11 | func doinit() {} 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !linux,arm64 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 64 10 | 11 | func doinit() {} 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_wasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build wasm 6 | 7 | package cpu 8 | 9 | // We're compiling the cpu package for an unknown (software-abstracted) CPU. 10 | // Make CacheLinePad an empty struct and hope that the usual struct alignment 11 | // rules are good enough. 12 | 13 | const cacheLineSize = 0 14 | 15 | func doinit() {} 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_x86.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386 amd64 amd64p32 6 | // +build !gccgo 7 | 8 | #include "textflag.h" 9 | 10 | // func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) 11 | TEXT ·cpuid(SB), NOSPLIT, $0-24 12 | MOVL eaxArg+0(FP), AX 13 | MOVL ecxArg+4(FP), CX 14 | CPUID 15 | MOVL AX, eax+8(FP) 16 | MOVL BX, ebx+12(FP) 17 | MOVL CX, ecx+16(FP) 18 | MOVL DX, edx+20(FP) 19 | RET 20 | 21 | // func xgetbv() (eax, edx uint32) 22 | TEXT ·xgetbv(SB),NOSPLIT,$0-8 23 | MOVL $0, CX 24 | XGETBV 25 | MOVL AX, eax+0(FP) 26 | MOVL DX, edx+4(FP) 27 | RET 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/asm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·use(SB),NOSPLIT,$0 8 | RET 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/asm_plan9_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | // 8 | // System call support for 386, Plan 9 9 | // 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-32 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-44 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 21 | JMP syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 24 | JMP syscall·RawSyscall6(SB) 25 | 26 | TEXT ·seek(SB),NOSPLIT,$0-36 27 | JMP syscall·seek(SB) 28 | 29 | TEXT ·exit(SB),NOSPLIT,$4-4 30 | JMP syscall·exit(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/asm_plan9_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | // 8 | // System call support for amd64, Plan 9 9 | // 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-64 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 21 | JMP syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | JMP syscall·RawSyscall6(SB) 25 | 26 | TEXT ·seek(SB),NOSPLIT,$0-56 27 | JMP syscall·seek(SB) 28 | 29 | TEXT ·exit(SB),NOSPLIT,$8-8 30 | JMP syscall·exit(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/env_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Plan 9 environment variables. 6 | 7 | package plan9 8 | 9 | import ( 10 | "syscall" 11 | ) 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package plan9 8 | 9 | import "syscall" 10 | 11 | func Unsetenv(key string) error { 12 | // This was added in Go 1.4. 13 | return syscall.Unsetenv(key) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/mksysnum_plan9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | 6 | COMMAND="mksysnum_plan9.sh $@" 7 | 8 | cat <= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Unsetenv(key string) error { 12 | // This was added in Go 1.4. 13 | return syscall.Unsetenv(key) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/export_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | var Itoa = itoa 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 16 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 17 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 18 | if errno == 0 { 19 | return nil 20 | } 21 | return errno 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (cmsg *Cmsghdr) SetLen(length int) { 22 | cmsg.Len = uint32(length) 23 | } 24 | 25 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 26 | // TODO(aram): implement this, see issue 5847. 27 | panic("unimplemented") 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for 386, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-8 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-4 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for amd64, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-32 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-8 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | // +build go1.4 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | func Unsetenv(key string) error { 13 | // This was added in Go 1.4. 14 | return syscall.Unsetenv(key) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Windows environment variables. 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | func Getenv(key string) (value string, found bool) { 12 | return syscall.Getenv(key) 13 | } 14 | 15 | func Setenv(key, value string) error { 16 | return syscall.Setenv(key, value) 17 | } 18 | 19 | func Clearenv() { 20 | syscall.Clearenv() 21 | } 22 | 23 | func Environ() []string { 24 | return syscall.Environ() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/memory_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | const ( 8 | MEM_COMMIT = 0x00001000 9 | MEM_RESERVE = 0x00002000 10 | MEM_DECOMMIT = 0x00004000 11 | MEM_RELEASE = 0x00008000 12 | MEM_RESET = 0x00080000 13 | MEM_TOP_DOWN = 0x00100000 14 | MEM_WRITE_WATCH = 0x00200000 15 | MEM_PHYSICAL = 0x00400000 16 | MEM_RESET_UNDO = 0x01000000 17 | MEM_LARGE_PAGES = 0x20000000 18 | 19 | PAGE_NOACCESS = 0x01 20 | PAGE_READONLY = 0x02 21 | PAGE_READWRITE = 0x04 22 | PAGE_WRITECOPY = 0x08 23 | PAGE_EXECUTE_READ = 0x20 24 | PAGE_EXECUTE_READWRITE = 0x40 25 | PAGE_EXECUTE_WRITECOPY = 0x80 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,!race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/registry/export_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package registry 8 | 9 | func (k Key) SetValue(name string, valtype uint32, data []byte) error { 10 | return k.setValue(name, valtype, data) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/registry/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package registry 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go syscall.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/svc/example/beep.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package main 8 | 9 | import ( 10 | "syscall" 11 | ) 12 | 13 | // BUG(brainman): MessageBeep Windows api is broken on Windows 7, 14 | // so this example does not beep when runs as service on Windows 7. 15 | 16 | var ( 17 | beepFunc = syscall.MustLoadDLL("user32.dll").MustFindProc("MessageBeep") 18 | ) 19 | 20 | func beep() { 21 | beepFunc.Call(0xffffffff) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/svc/go12.c: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | // +build !go1.3 7 | 8 | // copied from pkg/runtime 9 | typedef unsigned int uint32; 10 | typedef unsigned long long int uint64; 11 | #ifdef _64BIT 12 | typedef uint64 uintptr; 13 | #else 14 | typedef uint32 uintptr; 15 | #endif 16 | 17 | // from sys_386.s or sys_amd64.s 18 | void ·servicemain(void); 19 | 20 | void 21 | ·getServiceMain(uintptr *r) 22 | { 23 | *r = (uintptr)·servicemain; 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/svc/go12.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | // +build !go1.3 7 | 8 | package svc 9 | 10 | // from go12.c 11 | func getServiceMain(r *uintptr) 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v1/suite_test.go: -------------------------------------------------------------------------------- 1 | package yaml_test 2 | 3 | import ( 4 | . "gopkg.in/check.v1" 5 | "testing" 6 | ) 7 | 8 | func Test(t *testing.T) { TestingT(t) } 9 | 10 | type S struct{} 11 | 12 | var _ = Suite(&S{}) 13 | -------------------------------------------------------------------------------- /vendor/pifke.org/wpasupplicant/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - tip 5 | before_install: 6 | - go get github.com/mattn/goveralls 7 | script: 8 | - $HOME/gopath/bin/goveralls -service=travis-ci 9 | --------------------------------------------------------------------------------