/
log_session.go
45 lines (37 loc) · 1.4 KB
/
log_session.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// WARNING: This code is auto-generated from the Heroku Platform API JSON Schema
// by a Ruby script (gen/gen.rb). Changes should be made to the generation
// script rather than the generated files.
package heroku
import (
"time"
)
// A log session is a reference to the http based log stream for an app.
type LogSession struct {
// when log connection was created
CreatedAt time.Time `json:"created_at"`
// unique identifier of this log session
Id string `json:"id"`
// URL for log streaming session
LogplexURL string `json:"logplex_url"`
// when log session was updated
UpdatedAt time.Time `json:"updated_at"`
}
// Create a new log session.
//
// appIdentity is the unique identifier of the LogSession's App. options is the
// struct of optional parameters for this action.
func (c *Client) LogSessionCreate(appIdentity string, options *LogSessionCreateOpts) (*LogSession, error) {
var logSessionRes LogSession
return &logSessionRes, c.Post(&logSessionRes, "/apps/"+appIdentity+"/log-sessions", options)
}
// LogSessionCreateOpts holds the optional parameters for LogSessionCreate
type LogSessionCreateOpts struct {
// dyno to limit results to
Dyno *string `json:"dyno,omitempty"`
// number of log lines to stream at once
Lines *int `json:"lines,omitempty"`
// log source to limit results to
Source *string `json:"source,omitempty"`
// whether to stream ongoing logs
Tail *bool `json:"tail,omitempty"`
}