Commit 67ff6a1b authored by Zhu Yong's avatar Zhu Yong Committed by GitHub
Browse files

Merge pull request #6 from yongzhy/master

Add GoDoc link and Update kinetic protocol version to 3.0.7
parents 006bf887 55e0233e
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
# Kinetic-Go 

[![Build Status](https://travis-ci.org/Kinetic/kinetic-go.svg?branch=master)](https://travis-ci.org/Kinetic/kinetic-go)
[![GoDoc](https://godoc.org/github.com/Kinetic/kinetic-go?status.svg)](https://godoc.org/github.com/Kinetic/kinetic-go)

## Introduction

@@ -8,7 +9,7 @@ Kinetic client library in Golang.

## Kinetic Protocol Version

This client is using version `3.0.6` from [Kinetic-Protocol](https://github.com/Kinetic/kinetic-protocol)
This client is using version `3.0.7` from [Kinetic-Protocol](https://github.com/Kinetic/kinetic-protocol)

## Installation

@@ -16,7 +17,11 @@ Install with following command:

    go get github.com/Kinetic/kinetic-go 

## Usage
## Documents

Visit [https://godoc.org/github.com/Kinetic/kinetic-go](https://godoc.org/github.com/Kinetic/kinetic-go) to see API documents.

## Usage Examples

Refer to file `kinetic_test.go` and `connection_test.go` for some examples.

+22 −16
Original line number Diff line number Diff line
@@ -26,8 +26,8 @@ import (
	"io"
	"os"

	"github.com/Sirupsen/logrus"
	kproto "github.com/Kinetic/kinetic-go/proto"
	"github.com/Sirupsen/logrus"
)

// Create logger for Kinetic package
@@ -345,16 +345,18 @@ const (
	ALGO_SHA1   Algorithm = iota
	ALGO_SHA2   Algorithm = iota
	ALGO_SHA3   Algorithm = iota
	ALGO_CRC32 Algorithm = iota
	ALGO_CRC32C Algorithm = iota
	ALGO_CRC64  Algorithm = iota
	ALGO_CRC32  Algorithm = iota
)

var strAlgorithm = map[Algorithm]string{
	ALGO_SHA1:   "ALGO_SHA1",
	ALGO_SHA2:   "ALGO_SHA2",
	ALGO_SHA3:   "ALGO_SHA3",
	ALGO_CRC32: "ALGO_CRC32",
	ALGO_CRC32C: "ALGO_CRC32C",
	ALGO_CRC64:  "ALGO_CRC64",
	ALGO_CRC32:  "ALGO_CRC32",
}

func (a Algorithm) String() string {
@@ -374,10 +376,12 @@ func convertAlgoToProto(a Algorithm) kproto.Command_Algorithm {
		ret = kproto.Command_SHA2
	case ALGO_SHA3:
		ret = kproto.Command_SHA3
	case ALGO_CRC32:
		ret = kproto.Command_CRC32
	case ALGO_CRC32C:
		ret = kproto.Command_CRC32C
	case ALGO_CRC64:
		ret = kproto.Command_CRC64
	case ALGO_CRC32:
		ret = kproto.Command_CRC32
	}
	return ret
}
@@ -391,10 +395,12 @@ func convertAlgoFromProto(a kproto.Command_Algorithm) Algorithm {
		ret = ALGO_SHA2
	case kproto.Command_SHA3:
		ret = ALGO_SHA3
	case kproto.Command_CRC32:
		ret = ALGO_CRC32
	case kproto.Command_CRC32C:
		ret = ALGO_CRC32C
	case kproto.Command_CRC64:
		ret = ALGO_CRC64
	case kproto.Command_CRC32:
		ret = ALGO_CRC32
	}
	return ret
}
+188 −185

File changed.

Preview size limit exceeded, changes collapsed.

+5 −4
Original line number Diff line number Diff line
/**
 * Copyright 2013-2016 Seagate Technology LLC.
 * Copyright 2013-2015 Seagate Technology LLC.
 *
 * This Source Code Form is subject to the terms of the Mozilla
 * Public License, v. 2.0. If a copy of the MPL was not
@@ -22,7 +22,7 @@ option java_outer_classname = "Kinetic";
// the protocol version number by building this message
// and then reading the value.
message Local {
	optional string protocolVersion = 1 [default = "3.0.6"];
	optional string protocolVersion = 1 [default = "3.0.7"];
}

// THe message is an authorization and command bytes.
@@ -678,8 +678,9 @@ message Command {
		SHA1 = 1; // see NIST
		SHA2 = 2; // see NIST
		SHA3 = 3; // see NIST. The length of the tag determined the length of the hash
		CRC32 = 4; // the CRC32 is the standard Ethernet CRC32. See IEEE
		CRC64 = 5; // The CRC is ...
		CRC32C = 4;
		CRC64 = 5;
		CRC32 = 6;
		// 7-99 are reserved.
		// 100-inf are private algorithms.
	}