Преглед изворни кода

*: add missing package descriptions

This adds and updates package descriptions in etcd projects.
And also deletes some duplicate LICENSE statements.
Gyu-Ho Lee пре 10 година
родитељ
комит
81229dbea9

+ 2 - 0
discovery/discovery.go

@@ -12,6 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package discovery provides an implementation of the cluster discovery that
+// is used by etcd.
 package discovery
 
 import (

+ 2 - 3
error/error.go

@@ -12,9 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// error package describes errors in etcd project.
-// When any change happens, Documentation/errorcode.md needs to be updated
-// correspondingly.
+// error package describes errors in etcd project. When any change happens,
+// Documentation/errorcode.md needs to be updated correspondingly.
 package error
 
 import (

+ 2 - 6
discovery/doc.go → etcdctl/command/doc.go

@@ -12,9 +12,5 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-/*
-Package discovery provides an implementation of the cluster discovery that
-is used by etcd.
-
-*/
-package discovery
+// Package command is a set of libraries for etcdctl commands.
+package command

+ 1 - 0
etcdctl/main.go

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// etcdctl is a command line application that controls etcd.
 package main
 
 import (

+ 2 - 5
etcdserver/etcdhttp/httptypes/doc.go → etcdctlv3/command/doc.go

@@ -12,8 +12,5 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-/*
-Package httptypes defines how etcd's HTTP API entities are serialized to and deserialized from JSON.
-*/
-
-package httptypes
+// Package command is a set of libraries for etcd v3 commands.
+package command

+ 1 - 0
etcdctlv3/main.go

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// etcdctlv3 is a command line application that utilizes v3 API.
 package main
 
 import (

+ 1 - 0
etcdserver/api/v3rpc/key.go

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package v3rpc implements etcd v3 RPC system based on gRPC.
 package v3rpc
 
 import (

+ 1 - 0
etcdserver/auth/auth.go

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package auth implements etcd authentication.
 package auth
 
 import (

+ 16 - 0
etcdserver/doc.go

@@ -0,0 +1,16 @@
+// Copyright 2015 CoreOS, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package etcdserver defines how etcd servers interact and store their states.
+package etcdserver

+ 16 - 0
etcdserver/etcdhttp/doc.go

@@ -0,0 +1,16 @@
+// Copyright 2015 CoreOS, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package etcdhttp provides etcd client and server implementations.
+package etcdhttp

+ 2 - 0
etcdserver/etcdhttp/httptypes/member.go

@@ -12,6 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package httptypes defines how etcd's HTTP API entities are serialized to and
+// deserialized from JSON.
 package httptypes
 
 import (

+ 1 - 0
etcdserver/stats/stats.go

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package stats defines a standard interface for etcd cluster statistics.
 package stats
 
 import "github.com/coreos/etcd/Godeps/_workspace/src/github.com/coreos/pkg/capnslog"

+ 1 - 0
pkg/cors/cors.go

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package cors handles cross-origin HTTP requests (CORS).
 package cors
 
 import (

+ 2 - 0
pkg/crc/crc.go

@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Package crc provides utility function for cyclic redundancy check
+// algorithms.
 package crc
 
 import (

+ 1 - 0
pkg/fileutil/fileutil.go

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package fileutil implements utility functions related to files and paths.
 package fileutil
 
 import (

+ 1 - 0
pkg/flags/flag.go

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package flags implements command-line flag parsing.
 package flags
 
 import (

+ 1 - 0
pkg/httputil/cancelreq.go

@@ -6,6 +6,7 @@
 
 // +build go1.5
 
+// Package httputil provides HTTP utility functions.
 package httputil
 
 import "net/http"

+ 2 - 0
pkg/idutil/id.go

@@ -12,6 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package idutil implements utility functions for generating unique,
+// randomized ids.
 package idutil
 
 import (

+ 1 - 0
pkg/ioutil/reader.go

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package ioutil implements I/O utility functions.
 package ioutil
 
 import "io"

+ 1 - 0
pkg/netutil/netutil.go

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package netutil implements network-related utility functions.
 package netutil
 
 import (

+ 1 - 0
pkg/osutil/osutil.go

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package osutil implements operating system-related utility functions.
 package osutil
 
 import (

+ 2 - 0
pkg/pathutil/path.go

@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Package pathutil implements utility functions for handling slash-separated
+// paths.
 package pathutil
 
 import "path"

+ 1 - 0
pkg/pbutil/pbutil.go

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package pbutil defines interfaces for handling Protocol Buffer objects.
 package pbutil
 
 import "github.com/coreos/etcd/Godeps/_workspace/src/github.com/coreos/pkg/capnslog"

+ 1 - 0
pkg/runtime/fds_linux.go

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package runtime implements utility functions for runtime systems.
 package runtime
 
 import (

+ 1 - 0
pkg/testutil/testutil.go

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package testutil provides test utility functions.
 package testutil
 
 import (

+ 1 - 0
pkg/timeutil/timeutil.go

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package timeutil providese time-related utility functions.
 package timeutil
 
 import "time"

+ 17 - 0
pkg/transport/doc.go

@@ -0,0 +1,17 @@
+// Copyright 2015 CoreOS, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package transport implements various HTTP transport utilities based on Go
+// net package.
+package transport

+ 17 - 0
pkg/types/doc.go

@@ -0,0 +1,17 @@
+// Copyright 2015 CoreOS, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package types declares various data types and implements type-checking
+// functions.
+package types

+ 2 - 0
pkg/wait/wait.go

@@ -12,6 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package wait provides utility functions for polling, listening using Go
+// channel.
 package wait
 
 import (

+ 0 - 16
pkg/wait/wait_time.go

@@ -12,22 +12,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-/*
-   Copyright 2015 CoreOS, Inc.
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-
 package wait
 
 import (

+ 0 - 16
pkg/wait/wait_time_test.go

@@ -12,22 +12,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-/*
-
-   Copyright 2015 CoreOS, Inc.
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
 package wait
 
 import (

+ 18 - 0
proxy/doc.go

@@ -0,0 +1,18 @@
+// Copyright 2015 CoreOS, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package proxy implements etcd proxy node. The etcd proxy acts as a reverse
+// proxy forwarding client requests to active etcd cluster members, and does
+// not participate in consensus.
+package proxy

+ 16 - 0
raft/rafttest/doc.go

@@ -0,0 +1,16 @@
+// Copyright 2015 CoreOS, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package rafttest provides functional tests for etcd's raft implementation.
+package rafttest

+ 16 - 0
rafthttp/doc.go

@@ -0,0 +1,16 @@
+// Copyright 2015 CoreOS, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package rafthttp implements HTTP transportation layer for etcd/raft pkg.
+package rafthttp

+ 1 - 0
snap/snapshotter.go

@@ -12,6 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package snap stores raft nodes' states with snapshots.
 package snap
 
 import (

+ 16 - 0
storage/backend/doc.go

@@ -0,0 +1,16 @@
+// Copyright 2015 CoreOS, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package backend defines a standard interface for etcd's backend storage.
+package backend

+ 16 - 0
storage/doc.go

@@ -0,0 +1,16 @@
+// Copyright 2015 CoreOS, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package storage defines etcd's stable storage.
+package storage

+ 16 - 0
store/doc.go

@@ -0,0 +1,16 @@
+// Copyright 2015 CoreOS, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package store defines etcd's in-memory key/value store.
+package store

+ 2 - 0
version/version.go

@@ -12,6 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// Package version implements etcd version parsing and contains latest version
+// information.
 package version
 
 import (