INNER CODE UNIT · Go
generateUUIDFromInterface
kubernetes/k8s.io · infra/aws/aws-costexplorer-export/main.go:185
func generateUUIDFromInterface(i interface{}) string {
yamlString := marshalAsYAML(i)
sumBytes := sha256.Sum256([]byte(yamlString))
sum := fmt.Sprintf("%x", sumBytes)
sum = sum[:32]
id, _ := uuid.Parse(sum)
return id.String()
}
// usageClient stores the client for costexplorer
type usageClient struct {
client *costexplorer.Client
config AWSCostExplorerExportConfig
}
// GetInputForUsage returns an input for making the cost and usage data request
func (c usageClient) GetInputForUsage(nextPageToken *string) *costexplorer.GetCostAndUsageInput {
start := now.