Documentation ¶
Overview ¶
this file is adapted from by go-github package https://github.com/google/go-github/blob/master/github/timestamp.go
Index ¶
- Variables
- type Client
- type CustomError
- type Instance
- func (i *Instance) GetCacheHits() int64
- func (i *Instance) GetCacheSets() int64
- func (i *Instance) GetCreatedAt() Timestamp
- func (i *Instance) GetDescription() string
- func (i *Instance) GetFailedRequests() int64
- func (i *Instance) GetFeatures() []features.Feature
- func (i *Instance) GetID() int64
- func (i *Instance) GetInterceptedRequests() int64
- func (i *Instance) GetName() string
- func (i *Instance) GetRequests() int64
- func (i *Instance) GetSuccessfulRequests() int64
- func (i *Instance) GetUpdatedAt() Timestamp
- type InstanceStat
- func (is *InstanceStat) DeepCopy() (nis InstanceStat)
- func (is *InstanceStat) GetCacheHits() uint64
- func (is *InstanceStat) GetCacheSets() uint64
- func (is *InstanceStat) GetFailedRequests() uint64
- func (is *InstanceStat) GetInterceptedRequests() uint64
- func (is *InstanceStat) GetName() string
- func (is *InstanceStat) GetRequests() uint64
- func (is *InstanceStat) GetSuccessfulRequests() uint64
- func (is *InstanceStat) IsZero() bool
- type InstanceStatMutex
- type InstanceStatsService
- type InstancesService
- type Timestamp
Constants ¶
This section is empty.
Variables ¶
var BaseURL string
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { *resty.Client Token string Instances *InstancesService InstanceStats *InstanceStatsService // contains filtered or unexported fields }
type CustomError ¶
func (*CustomError) Error ¶
func (r *CustomError) Error() string
type Instance ¶
type Instance struct { ID *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` Requests *int64 `json:"requests,omitempty"` InterceptedRequests *int64 `json:"intercepted_requests,omitempty"` SuccessfulRequests *int64 `json:"successful_requests,omitempty"` FailedRequests *int64 `json:"failed_requests,omitempty"` CacheHits *int64 `json:"cache_hits,omitempty"` CacheSets *int64 `json:"cache_sets,omitempty"` Features *[]features.Feature `json:"features,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` }
func (*Instance) GetCacheHits ¶ added in v0.5.0
GetCacheHits returns the CacheHits field if it's non-nil, zero value otherwise.
func (*Instance) GetCacheSets ¶ added in v0.5.0
GetCacheSets returns the CacheSets field if it's non-nil, zero value otherwise.
func (*Instance) GetCreatedAt ¶
GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.
func (*Instance) GetDescription ¶
GetDescription returns the Description field if it's non-nil, zero value otherwise.
func (*Instance) GetFailedRequests ¶ added in v0.5.0
GetFailedRequests returns the FailedRequests field if it's non-nil, zero value otherwise.
func (*Instance) GetFeatures ¶ added in v0.2.0
GetFeatures returns the Features field if it's non-nil, zero value otherwise.
func (*Instance) GetInterceptedRequests ¶ added in v0.5.0
GetInterceptedRequests returns the InterceptedRequests field if it's non-nil, zero value otherwise.
func (*Instance) GetRequests ¶ added in v0.1.4
GetRequests returns the Requests field if it's non-nil, zero value otherwise.
func (*Instance) GetSuccessfulRequests ¶ added in v0.7.7
GetSuccessfulRequests returns the SuccessfulRequests field if it's non-nil, zero value otherwise.
func (*Instance) GetUpdatedAt ¶
GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.
type InstanceStat ¶ added in v0.1.4
type InstanceStat struct { Name *string `json:"name,omitempty"` Requests *uint64 `json:"requests,omitempty"` InterceptedRequests *uint64 `json:"intercepted_requests,omitempty"` SuccessfulRequests *uint64 `json:"successful_requests,omitempty"` FailedRequests *uint64 `json:"failed_requests,omitempty"` CacheHits *uint64 `json:"cache_hits,omitempty"` CacheSets *uint64 `json:"cache_sets,omitempty"` }
func (*InstanceStat) DeepCopy ¶ added in v0.1.4
func (is *InstanceStat) DeepCopy() (nis InstanceStat)
DeepCopy goes through the fields and copy them, so that all values are copied, and all pointer don't point to the same address
func (*InstanceStat) GetCacheHits ¶ added in v0.4.0
func (is *InstanceStat) GetCacheHits() uint64
GetCacheHits returns the CacheHits field if it's non-nil, zero value otherwise.
func (*InstanceStat) GetCacheSets ¶ added in v0.4.0
func (is *InstanceStat) GetCacheSets() uint64
GetCacheSets returns the CacheSets field if it's non-nil, zero value otherwise.
func (*InstanceStat) GetFailedRequests ¶ added in v0.4.0
func (is *InstanceStat) GetFailedRequests() uint64
GetFailedRequests returns the FailedRequests field if it's non-nil, zero value otherwise.
func (*InstanceStat) GetInterceptedRequests ¶ added in v0.4.0
func (is *InstanceStat) GetInterceptedRequests() uint64
GetInterceptedRequests returns the InterceptedRequests field if it's non-nil, zero value otherwise.
func (*InstanceStat) GetName ¶ added in v0.1.4
func (is *InstanceStat) GetName() string
GetName returns the Name field if it's non-nil, zero value otherwise.
func (*InstanceStat) GetRequests ¶ added in v0.1.4
func (is *InstanceStat) GetRequests() uint64
GetRequests returns the Requests field if it's non-nil, zero value otherwise.
func (*InstanceStat) GetSuccessfulRequests ¶ added in v0.7.7
func (is *InstanceStat) GetSuccessfulRequests() uint64
GetSuccessfulRequests returns the SuccessfulRequests field if it's non-nil, zero value otherwise.
func (*InstanceStat) IsZero ¶ added in v0.1.4
func (is *InstanceStat) IsZero() bool
IsZero checks if it is zero value
type InstanceStatMutex ¶ added in v0.1.4
type InstanceStatMutex struct { InstanceStat Mutex *sync.Mutex }
InstanceStatMutex is used for struct to for atomic incr and decr of counters
type InstanceStatsService ¶ added in v0.1.4
type InstanceStatsService service
func (*InstanceStatsService) Update ¶ added in v0.1.4
func (s *InstanceStatsService) Update(ctx context.Context, is InstanceStat) (*Instance, *resty.Response, error)
type InstancesService ¶
type InstancesService service
type Timestamp ¶
Timestamp represents a time that can be unmarshalled from a JSON string formatted as either an RFC3339 or Unix timestamp. This is necessary for some fields since the GitHub API is inconsistent in how it represents times. All exported methods of time.Time can be called on Timestamp.
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. Time is expected in RFC3339 or Unix format.