-
Notifications
You must be signed in to change notification settings - Fork 82
/
lke_types.go
47 lines (37 loc) · 1.06 KB
/
lke_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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package linodego
import (
"context"
)
// LKEType represents a single valid LKE type.
// NOTE: This typically corresponds to the availability of a cluster's
// control plane.
type LKEType struct {
baseType[LKETypePrice, LKETypeRegionPrice]
}
// LKETypePrice represents the base hourly and monthly prices
// for an LKE type entry.
type LKETypePrice struct {
baseTypePrice
}
// LKETypeRegionPrice represents the regional hourly and monthly prices
// for an LKE type entry.
type LKETypeRegionPrice struct {
baseTypeRegionPrice
}
// ListLKETypes lists LKE types. This endpoint is cached by default.
func (c *Client) ListLKETypes(ctx context.Context, opts *ListOptions) ([]LKEType, error) {
e := "lke/types"
endpoint, err := generateListCacheURL(e, opts)
if err != nil {
return nil, err
}
if result := c.getCachedResponse(endpoint); result != nil {
return result.([]LKEType), nil
}
response, err := getPaginatedResults[LKEType](ctx, c, e, opts)
if err != nil {
return nil, err
}
c.addCachedResponse(endpoint, response, &cacheExpiryTime)
return response, nil
}