-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
32 lines (28 loc) · 883 Bytes
/
types.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
package main
import "strings"
// PubSubMessage is the payload of a Pub/Sub event.
// See the documentation for more details:
// https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage
type PubSubMessage struct {
Message struct {
Data []byte `json:"data,omitempty"`
ID string `json:"id"`
} `json:"message"`
Subscription string `json:"subscription"`
}
// gceInstance holds information about individual VMs obtained from v1.compute.instances.insert AuditLog CloudEvents
type gceInstance struct {
insertid string
targetLink string
instanceid string
zone string
projectid string
networktags []string
}
// this doesn't land until go 1.20 is released https://github.com/golang/go/issues/42537
func CutPrefix(s, prefix string) (after string, found bool) {
if !strings.HasPrefix(s, prefix) {
return s, false
}
return s[len(prefix):], true
}