Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement TailProcessStdoutLog and add go mod #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/abrander/go-supervisord

go 1.16
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually require Go 1.16 for anything..? I'm not that familiar with modules - but can you use this with a Go version older than 1.16?


require github.com/kolo/xmlrpc v0.0.0-20201022064351-38db28db192b
5 changes: 5 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
github.com/kolo/xmlrpc v0.0.0-20201022064351-38db28db192b h1:iNjcivnc6lhbvJA3LD622NPrUponluJrBWPIwGG/3Bg=
github.com/kolo/xmlrpc v0.0.0-20201022064351-38db28db192b/go.mod h1:pcaDhQK0/NJZEvtCO0qQPPropqV0sJOJ6YW7X+9kRwM=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
14 changes: 12 additions & 2 deletions processlogging.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@ func (c *Client) ReadProcessStderrLog(name string, offset int, length int) (stri
}

// This is not implemented yet.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should update the comment.

func (c *Client) TailProcessStdoutLog(name string, offset int, length int) ([]LogSegment, error) {
return nil, FIXMENotImplementedError
func (c *Client) TailProcessStdoutLog(name string, offset int, length int) (string, error) {
ret := make([]interface{}, 0)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is interface{} needed? You're type asserting to string below..?


err := c.Call("supervisor.tailProcessStdoutLog", []interface{}{name, offset, length}, &ret)
if err != nil {
return "", err
}
msg, ok := ret[0].(string)
if ok {
return msg, nil
}
return "", nil
}

// This is not implemented yet.
Expand Down