Categorygithub.com/jjttech/cloudzero-client-go

# README

CloudZero Client Go

Testing Go Report Card GoDoc License Release

Example

See examples:

package main

import (
  "os"

  log "github.com/sirupsen/logrus"

  "github.com/jjttech/cloudzero-client-go/cloudzero"
)

func main() {
  var (
    cz  *cloudzero.CloudZero
    err error
  )

  if cz, err = cloudzero.New(); err != nil {
    log.WithError(err).Fatal("unable to create CloudZero client")
  }

  // Load from the default filename "definition.yaml" in the current directory
  def, err := cz.CostFormation.ReadFile(cloudzero.DefaultDefinitionFilename)
  if err != nil {
    log.WithError(err).Fatal("unable to load file")
  }

  // Print to the screen
  if err = cz.CostFormation.Write(def, os.Stdout); err != nil {
    log.WithError(err).Fatal("unable to write file")
  }
}

Development

Requirements

  • Go 1.19.0+
  • GNU Make
  • git

Building

# Default target is 'build'
$ make

# Explicitly run build
$ make build

# Locally test the CI build scripts
# make build-ci

Testing

Before contributing, all linting and tests must pass. Tests can be run directly via:

# Tests and Linting
$ make test

# Only unit tests
$ make test-unit

# Only integration tests
$ make test-integration

Commit Messages

Using the following format for commit messages allows for auto-generation of the CHANGELOG:

Format:

<type>(<scope>): <subject>

TypeDescriptionChange log?
choreMaintenance type workNo
docsDocumentation UpdatesYes
featNew FeaturesYes
fixBug FixesYes
refactorCode RefactoringNo

Scope

This refers to what part of the code is the focus of the work. For example:

General:

  • build - Work related to the build system (linting, makefiles, CI/CD, etc)
  • release - Work related to cutting a new release

Package Specific:

  • cmd/jjttech - Work related to the jjttech binary / command
  • internal/http - Work related to the internal/http package
  • pkg/alerts - Work related to the pkg/alerts package

Documentation

Note: This requires the repo to be in your GOPATH (godoc issue)

$ make docs

Open Source License

This project is distributed under the Apache 2 license.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author