Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stijn Meijer
winsvc
Commits
a7bde37f
Commit
a7bde37f
authored
Apr 12, 2018
by
Stijn Meijer
Browse files
Fork imports
parent
f8fb11f8
Changes
18
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
a7bde37f
...
...
@@ -8,16 +8,16 @@ can be guessed from the name, it only works on Windows.
Full
`go doc`
style documentation for the project can be viewed online without
installing this package by using the GoDoc site here:
http://godoc.org/git
hub.com/btcsuite
/winsvc
http://godoc.org/git
lab.science.ru.nl/stijnmeijer
/winsvc
You can also view the documentation locally once the package is installed with
the
`godoc`
tool by running
`godoc -http=":6060"`
and pointing your browser to
http://localhost:6060/pkg/git
hub.com/btcsuite
/winsvc
http://localhost:6060/pkg/git
lab.science.ru.nl/stijnmeijer
/winsvc
## Installation
```
bash
$
go get git
hub.com/btcsuite
/winsvc
$
go get git
lab.science.ru.nl/stijnmeijer
/winsvc
```
## License
...
...
debug/service.go
View file @
a7bde37f
...
...
@@ -13,7 +13,7 @@ import (
"os/signal"
"syscall"
"git
hub.com/btcsuite
/winsvc/svc"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/svc"
)
// Run executes service named name by calling appropriate handler function.
...
...
eventlog/install.go
View file @
a7bde37f
...
...
@@ -10,8 +10,8 @@ import (
"errors"
"syscall"
"git
hub.com/btcsuite
/winsvc/registry"
"git
hub.com/btcsuite
/winsvc/winapi"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/registry"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/winapi"
)
const
(
...
...
eventlog/log.go
View file @
a7bde37f
...
...
@@ -12,7 +12,7 @@ import (
"errors"
"syscall"
"git
hub.com/btcsuite
/winsvc/winapi"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/winapi"
)
// Log provides access to system log.
...
...
eventlog/log_test.go
View file @
a7bde37f
...
...
@@ -9,7 +9,7 @@ package eventlog_test
import
(
"testing"
"git
hub.com/btcsuite
/winsvc/eventlog"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/eventlog"
)
func
TestLog
(
t
*
testing
.
T
)
{
...
...
example/install.go
View file @
a7bde37f
...
...
@@ -11,8 +11,8 @@ import (
"os"
"path/filepath"
"git
hub.com/btcsuite
/winsvc/eventlog"
"git
hub.com/btcsuite
/winsvc/mgr"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/eventlog"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/mgr"
)
func
exePath
()
(
string
,
error
)
{
...
...
example/main.go
View file @
a7bde37f
...
...
@@ -18,7 +18,7 @@ import (
"os"
"strings"
"git
hub.com/btcsuite
/winsvc/svc"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/svc"
)
func
usage
(
errmsg
string
)
{
...
...
example/manage.go
View file @
a7bde37f
...
...
@@ -10,8 +10,8 @@ import (
"fmt"
"time"
"git
hub.com/btcsuite
/winsvc/mgr"
"git
hub.com/btcsuite
/winsvc/svc"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/mgr"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/svc"
)
func
startService
(
name
string
)
error
{
...
...
example/service.go
View file @
a7bde37f
...
...
@@ -10,9 +10,9 @@ import (
"fmt"
"time"
"git
hub.com/btcsuite
/winsvc/debug"
"git
hub.com/btcsuite
/winsvc/eventlog"
"git
hub.com/btcsuite
/winsvc/svc"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/debug"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/eventlog"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/svc"
)
var
elog
debug
.
Log
...
...
mgr/config.go
View file @
a7bde37f
...
...
@@ -10,7 +10,7 @@ import (
"syscall"
"unsafe"
"git
hub.com/btcsuite
/winsvc/winapi"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/winapi"
)
const
(
...
...
mgr/mgr.go
View file @
a7bde37f
...
...
@@ -14,7 +14,7 @@ package mgr
import
(
"syscall"
"git
hub.com/btcsuite
/winsvc/winapi"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/winapi"
)
// Mgr is used to manage Windows service.
...
...
mgr/mgr_test.go
View file @
a7bde37f
...
...
@@ -11,7 +11,7 @@ import (
"path/filepath"
"testing"
"git
hub.com/btcsuite
/winsvc/mgr"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/mgr"
)
func
TestOpenLanManServer
(
t
*
testing
.
T
)
{
...
...
mgr/service.go
View file @
a7bde37f
...
...
@@ -9,8 +9,8 @@ package mgr
import
(
"syscall"
"git
hub.com/btcsuite
/winsvc/svc"
"git
hub.com/btcsuite
/winsvc/winapi"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/svc"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/winapi"
)
// TODO(brainman): use EnumDependentServices to enumerate dependent services
...
...
registry/registry.go
View file @
a7bde37f
...
...
@@ -12,7 +12,7 @@ import (
"syscall"
"unsafe"
"git
hub.com/btcsuite
/winsvc/winapi"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/winapi"
)
type
Key
struct
{
...
...
svc/event.go
View file @
a7bde37f
...
...
@@ -10,7 +10,7 @@ import (
"errors"
"syscall"
"git
hub.com/btcsuite
/winsvc/winapi"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/winapi"
)
// event represents auto-reset, initially non-signaled windows event.
...
...
svc/security.go
View file @
a7bde37f
...
...
@@ -10,7 +10,7 @@ import (
"syscall"
"unsafe"
"git
hub.com/btcsuite
/winsvc/winapi"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/winapi"
)
// TODO(brainman): move some of that code to syscall/security.go
...
...
svc/service.go
View file @
a7bde37f
...
...
@@ -14,7 +14,7 @@ import (
"syscall"
"unsafe"
"git
hub.com/btcsuite
/winsvc/winapi"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/winapi"
)
// State describes service execution state (Stopped, Running and so on).
...
...
svc/svc_test.go
View file @
a7bde37f
...
...
@@ -14,8 +14,8 @@ import (
"testing"
"time"
"git
hub.com/btcsuite
/winsvc/mgr"
"git
hub.com/btcsuite
/winsvc/svc"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/mgr"
"git
lab.science.ru.nl/stijnmeijer
/winsvc/svc"
)
func
getState
(
t
*
testing
.
T
,
s
*
mgr
.
Service
)
svc
.
State
{
...
...
@@ -62,7 +62,7 @@ func TestExample(t *testing.T) {
defer
os
.
RemoveAll
(
dir
)
exepath
:=
filepath
.
Join
(
dir
,
"a.exe"
)
o
,
err
:=
exec
.
Command
(
"go"
,
"build"
,
"-o"
,
exepath
,
"git
hub.com/btcsuite
/winsvc/example"
)
.
CombinedOutput
()
o
,
err
:=
exec
.
Command
(
"go"
,
"build"
,
"-o"
,
exepath
,
"git
lab.science.ru.nl/stijnmeijer
/winsvc/example"
)
.
CombinedOutput
()
if
err
!=
nil
{
t
.
Fatalf
(
"failed to build service program: %v
\n
%v"
,
err
,
string
(
o
))
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment