go-nexentastor

module
v2.7.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2022 License: Apache-2.0

README

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.

Directories

Path Synopsis
pkg
ns

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL