Versions in this module Expand all Collapse all v0 v0.3.0 Nov 6, 2023 Changes in this version + var ContextAPIKey = contextKey("apikey") + var ContextAccessToken = contextKey("accesstoken") + var ContextBasicAuth = contextKey("basic") + var ContextOAuth2 = contextKey("token") + var Namespace = os.Getenv("NAMESPACE_NAME") + var PodName = os.Getenv("POD_NAME") + func CacheExpires(r *http.Response) time.Time + type APIClient struct + CarbonAwareApi *CarbonAwareApiService + LocationsApi *LocationsApiService + func NewAPIClient(cfg *Configuration) *APIClient + func (c *APIClient) ChangeBasePath(path string) + type APIKey struct + Key string + Prefix string + type APIResponse struct + Message string + Method string + Operation string + Payload []byte + RequestURL string + func NewAPIResponse(r *http.Response) *APIResponse + func NewAPIResponseWithError(errorMessage string) *APIResponse + type BasicAuth struct + Password string + UserName string + type CarbonAwareApiBatchForecastDataAsyncOpts struct + Body optional.Interface + type CarbonAwareApiGetAverageCarbonIntensityBatchOpts struct + Body optional.Interface + type CarbonAwareApiGetBestEmissionsDataForLocationsByTimeOpts struct + Time optional.Time + ToTime optional.Time + type CarbonAwareApiGetCurrentForecastDataOpts struct + DataEndAt optional.Time + DataStartAt optional.Time + WindowSize optional.Int32 + type CarbonAwareApiGetEmissionsDataForLocationByTimeOpts struct + EndTime optional.Time + StartTime optional.Time + type CarbonAwareApiGetEmissionsDataForLocationsByTimeOpts struct + Time optional.Time + ToTime optional.Time + type CarbonAwareApiService service + func (a *CarbonAwareApiService) BatchForecastDataAsync(ctx context.Context, ...) ([]EmissionsForecastDto, *http.Response, error) + func (a *CarbonAwareApiService) GetAverageCarbonIntensity(ctx context.Context, location string, startTime time.Time, endTime time.Time) (CarbonIntensityDto, *http.Response, error) + func (a *CarbonAwareApiService) GetAverageCarbonIntensityBatch(ctx context.Context, ...) ([]CarbonIntensityDto, *http.Response, error) + func (a *CarbonAwareApiService) GetBestEmissionsDataForLocationsByTime(ctx context.Context, location []string, ...) ([]EmissionsData, *http.Response, error) + func (a *CarbonAwareApiService) GetCurrentForecastData(ctx context.Context, location []string, ...) ([]EmissionsForecastDto, *http.Response, error) + func (a *CarbonAwareApiService) GetEmissionsDataForLocationByTime(ctx context.Context, location string, ...) ([]EmissionsData, *http.Response, error) + func (a *CarbonAwareApiService) GetEmissionsDataForLocationsByTime(ctx context.Context, location []string, ...) ([]EmissionsData, *http.Response, error) + type CarbonIntensityBatchParametersDto struct + EndTime time.Time + Location string + StartTime time.Time + type CarbonIntensityDto struct + CarbonIntensity float64 + EndTime time.Time + Location string + StartTime time.Time + type Configuration struct + BasePath string + DefaultHeader map[string]string + HTTPClient *http.Client + Host string + Scheme string + UserAgent string + func NewConfiguration() *Configuration + func (c *Configuration) AddDefaultHeader(key string, value string) + type EmissionsData struct + Duration string + Location string + Rating float64 + Time time.Time + type EmissionsDataDto struct + Duration int32 + Location string + Timestamp time.Time + Value float64 + type EmissionsForecastBatchParametersDto struct + DataEndAt time.Time + DataStartAt time.Time + Location string + RequestedAt time.Time + WindowSize int32 + type EmissionsForecastDto struct + DataEndAt time.Time + DataStartAt time.Time + ForecastData []EmissionsDataDto + GeneratedAt time.Time + Location string + OptimalDataPoints []EmissionsDataDto + RequestedAt time.Time + WindowSize int32 + type GenericSwaggerError struct + func (e GenericSwaggerError) Body() []byte + func (e GenericSwaggerError) Error() string + func (e GenericSwaggerError) Model() interface{} + type Location struct + Latitude float64 + Longitude float64 + Name string + type LocationsApiService service + func (a *LocationsApiService) GetAllLocations(ctx context.Context) (map[string]Location, *http.Response, error)