Giter Club home page Giter Club logo

go-nexentastor's Introduction

go-nexentastor

Build Status Go Report Card Conventional Commits

Go library for accessing NexentaStor API.

Latest version

Releases

See CHANGELOG.md

Documentation

To see docs for a specific version, change Git branch to version tag.

Full API documentation for all packages is here.

Package "ns"

  • ns.Provider - single NexentaStor API provider. See list of all provider API methods here. Example:
    l := logrus.New()
    nsProvider, err := ns.NewProvider(ns.ProviderArgs{
        Address:  "https://10.3.199.252:8443",
        Username: "admin",
        Password: "pass",
        Log:      l,
    })
    pools, err := nsProvider.GetPools()
  • ns.Resolver - NexentaStor HA cluster API provider. Resolves NexentaStor by specified filesystem path. Example:
    l := logrus.New()
    nsResolver, err := ns.NewResolver(ns.ResolverArgs{
        Address:  "https://10.3.199.252:8443,https://10.3.199.253:8443",
        Username: "admin",
        Password: "pass",
        Log:      l,
    })
    // returns a provider for NS that has "poolA/datasetA"
    nsProvider, err := nsResolver.Resolve("poolA/datasetA")
    filesystems, err := nsProvider.GetFilesystems("poolA/datasetA/parentFS")

Development

Commits should follow Conventional Commits Spec. Commit messages which include feat: and fix: prefixes will be included in CHANGELOG automatically.

Tests

See Makefile for more examples.

# Test options:
# - TEST_NS_SINGLE=https://10.3.199.254:8443 # single NS
# - TEST_NS_HA_1=https://10.3.199.252:8443   # first node of HA NS cluster
# - TEST_NS_HA_2=https://10.3.199.253:8443   # second node of HA NS cluster
# - NOCOLORS=true                            # disable colors

# run all tests on local machine:
TEST_NS_SINGLE=https://10.3.199.251:8443 \
TEST_NS_HA_1=https://10.3.199.252:8443 \
TEST_NS_HA_2=https://10.3.199.253:8443 \
make test

# run all tests in containers:
TEST_NS_SINGLE=https://10.3.199.251:8443 \
TEST_NS_HA_1=https://10.3.199.252:8443 \
TEST_NS_HA_2=https://10.3.199.253:8443 \
make test-container

End-to-end NexentaStor test parameters:

# Tests for NexentaStor API provider (same options for `./resolver/resolver_test.go`)
go test ./tests/e2e/ns/provider/provider_test.go -v -count 1 \
    --address="https://10.3.199.254:8443" \
    --username="admin" \
    --password="pass" \
    --pool="testPool" \
    --dataset="testDataset" \
    --filesystem="testFilesystem" \
    --cluster=true \
    --log=true

Deps

To update deps run:

# go get -u github.com/golang/dep/cmd/dep
~/go/bin/dep ensure

Release

All development happens in master branch, when it's time to publish a new version, new git tag should be created.

Each API change MUST be released as git tag (vX.X.X).

  1. Test the new version:

    make test
  2. To release a new version, run the command:

    VERSION=X.X.X make release

    This script does following:

    • generates new CHANGELOG.md
    • generates new ./docs/*
    • creates git tag 'vX.X.X' and pushes it to the repository
  3. Update Github releases.

go-nexentastor's People

Contributors

antonfisher avatar evgeniiivanov avatar qeas avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

elapfra mape90

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.