Documentation ¶
Overview ¶
Package macservice defines the client API for MacService.
Index ¶
- type Client
- type DiskSelection
- type FindRequest
- type FindResponse
- type ImageHashes
- type Instance
- type InstanceSpecification
- type Lease
- type LeaseRequest
- type LeaseResponse
- type MachineProfile
- type MetadataEntry
- type Namespace
- type NetworkAccessLevel
- type RenewRequest
- type RenewResponse
- type VacateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a MacService client.
func (*Client) Find ¶
func (c *Client) Find(req FindRequest) (FindResponse, error)
Find searches for leases.
func (*Client) Lease ¶
func (c *Client) Lease(req LeaseRequest) (LeaseResponse, error)
Lease creates a new lease.
func (*Client) Renew ¶
func (c *Client) Renew(req RenewRequest) (RenewResponse, error)
Renew updates the expiration time of a lease. Note that RenewRequest.Duration is the lease duration from now, not from the current lease expiration time.
type DiskSelection ¶
type DiskSelection struct {
ImageHashes ImageHashes `json:"imageHashes"`
}
type FindRequest ¶
type FindRequest struct {
VMResourceNamespace Namespace `json:"vmResourceNamespace"`
}
type FindResponse ¶
type FindResponse struct {
Instances []Instance `json:"instances"`
}
type ImageHashes ¶
type ImageHashes struct {
BootSHA256 string `json:"bootSha256"`
}
type Instance ¶
type Instance struct { Lease Lease `json:"lease"` InstanceSpecification InstanceSpecification `json:"instanceSpecification"` }
type InstanceSpecification ¶
type InstanceSpecification struct { Profile MachineProfile `json:"profile"` AccessLevel NetworkAccessLevel `json:"accessLevel"` Metadata []MetadataEntry `json:"metadata"` DiskSelection DiskSelection `json:"diskSelection"` }
type LeaseRequest ¶
type LeaseRequest struct { VMResourceNamespace Namespace `json:"vmResourceNamespace"` InstanceSpecification InstanceSpecification `json:"instanceSpecification"` // Duration is ultimately a Duration protobuf message. // // https://pkg.go.dev/google.golang.org/protobuf@v1.31.0/types/known/durationpb#hdr-JSON_Mapping: // "In JSON format, the Duration type is encoded as a string rather // than an object, where the string ends in the suffix "s" (indicating // seconds) and is preceded by the number of seconds, with nanoseconds // expressed as fractional seconds." Duration string `json:"duration"` }
type LeaseResponse ¶
type LeaseResponse struct {
PendingLease Lease `json:"pendingLease"`
}
type MachineProfile ¶
type MachineProfile string
const (
V1_MEDIUM_VM MachineProfile = "V1_MEDIUM_VM"
)
type MetadataEntry ¶
type NetworkAccessLevel ¶
type NetworkAccessLevel string
const (
GOLANG_OSS NetworkAccessLevel = "GOLANG_OSS"
)
type RenewRequest ¶
type RenewRequest struct { LeaseID string `json:"leaseId"` // Duration is ultimately a Duration protobuf message. // // https://pkg.go.dev/google.golang.org/protobuf@v1.31.0/types/known/durationpb#hdr-JSON_Mapping: // "In JSON format, the Duration type is encoded as a string rather // than an object, where the string ends in the suffix "s" (indicating // seconds) and is preceded by the number of seconds, with nanoseconds // expressed as fractional seconds." Duration string `json:"duration"` }
type RenewResponse ¶
type VacateRequest ¶
type VacateRequest struct {
LeaseID string `json:"leaseId"`
}
Click to show internal directories.
Click to hide internal directories.