diff --git a/discovery/discovery.go b/discovery/discovery.go index 0ad3d0c18..4207606fd 100644 --- a/discovery/discovery.go +++ b/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 ( diff --git a/error/error.go b/error/error.go index 56facdc01..499823dbb 100644 --- a/error/error.go +++ b/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 ( diff --git a/discovery/doc.go b/etcdctl/command/doc.go similarity index 83% rename from discovery/doc.go rename to etcdctl/command/doc.go index 18cfd78c1..7e95e656a 100644 --- a/discovery/doc.go +++ b/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 diff --git a/etcdctl/main.go b/etcdctl/main.go index c2fd73346..57567d319 100644 --- a/etcdctl/main.go +++ b/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 ( diff --git a/etcdserver/etcdhttp/httptypes/doc.go b/etcdctlv3/command/doc.go similarity index 82% rename from etcdserver/etcdhttp/httptypes/doc.go rename to etcdctlv3/command/doc.go index fa0158020..b9420fe90 100644 --- a/etcdserver/etcdhttp/httptypes/doc.go +++ b/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 diff --git a/etcdctlv3/main.go b/etcdctlv3/main.go index 835368b33..75e9c9d6d 100644 --- a/etcdctlv3/main.go +++ b/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 ( diff --git a/etcdserver/api/v3rpc/key.go b/etcdserver/api/v3rpc/key.go index cf4bd4129..449182ccc 100644 --- a/etcdserver/api/v3rpc/key.go +++ b/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 ( diff --git a/etcdserver/auth/auth.go b/etcdserver/auth/auth.go index 609ee7aeb..46c1de24e 100644 --- a/etcdserver/auth/auth.go +++ b/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 ( diff --git a/etcdserver/doc.go b/etcdserver/doc.go new file mode 100644 index 000000000..a444d528d --- /dev/null +++ b/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 diff --git a/etcdserver/etcdhttp/doc.go b/etcdserver/etcdhttp/doc.go new file mode 100644 index 000000000..84883aaf1 --- /dev/null +++ b/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 diff --git a/etcdserver/etcdhttp/httptypes/member.go b/etcdserver/etcdhttp/httptypes/member.go index 30ecbb539..432f73a4f 100644 --- a/etcdserver/etcdhttp/httptypes/member.go +++ b/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 ( diff --git a/etcdserver/stats/stats.go b/etcdserver/stats/stats.go index 5bda72327..a917a120b 100644 --- a/etcdserver/stats/stats.go +++ b/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" diff --git a/pkg/cors/cors.go b/pkg/cors/cors.go index b1a0baf08..d149d10a2 100644 --- a/pkg/cors/cors.go +++ b/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 ( diff --git a/pkg/crc/crc.go b/pkg/crc/crc.go index b4e7c8da0..4b998a484 100644 --- a/pkg/crc/crc.go +++ b/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 ( diff --git a/pkg/fileutil/fileutil.go b/pkg/fileutil/fileutil.go index 7a39ca554..b728a4953 100644 --- a/pkg/fileutil/fileutil.go +++ b/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 ( diff --git a/pkg/flags/flag.go b/pkg/flags/flag.go index 30a1b11e1..9dc5a085b 100644 --- a/pkg/flags/flag.go +++ b/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 ( diff --git a/pkg/httputil/cancelreq.go b/pkg/httputil/cancelreq.go index ebebcb3d9..e3a7a7422 100644 --- a/pkg/httputil/cancelreq.go +++ b/pkg/httputil/cancelreq.go @@ -6,6 +6,7 @@ // +build go1.5 +// Package httputil provides HTTP utility functions. package httputil import "net/http" diff --git a/pkg/idutil/id.go b/pkg/idutil/id.go index 02f3aa866..0ba570cff 100644 --- a/pkg/idutil/id.go +++ b/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 ( diff --git a/pkg/ioutil/reader.go b/pkg/ioutil/reader.go index 412f3915a..8ef9a9330 100644 --- a/pkg/ioutil/reader.go +++ b/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" diff --git a/pkg/netutil/netutil.go b/pkg/netutil/netutil.go index 62aacf2c3..771b863f2 100644 --- a/pkg/netutil/netutil.go +++ b/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 ( diff --git a/pkg/osutil/osutil.go b/pkg/osutil/osutil.go index 6e8f9f035..6ece3b18d 100644 --- a/pkg/osutil/osutil.go +++ b/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 ( diff --git a/pkg/pathutil/path.go b/pkg/pathutil/path.go index 82fd1db39..f26254ba9 100644 --- a/pkg/pathutil/path.go +++ b/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" diff --git a/pkg/pbutil/pbutil.go b/pkg/pbutil/pbutil.go index 66693a2f2..d22d945b0 100644 --- a/pkg/pbutil/pbutil.go +++ b/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" diff --git a/pkg/runtime/fds_linux.go b/pkg/runtime/fds_linux.go index 85297c09d..d81114405 100644 --- a/pkg/runtime/fds_linux.go +++ b/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 ( diff --git a/pkg/testutil/testutil.go b/pkg/testutil/testutil.go index 49a25da00..a884bd10d 100644 --- a/pkg/testutil/testutil.go +++ b/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 ( diff --git a/pkg/timeutil/timeutil.go b/pkg/timeutil/timeutil.go index 58da59397..272e6f529 100644 --- a/pkg/timeutil/timeutil.go +++ b/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" diff --git a/pkg/transport/doc.go b/pkg/transport/doc.go new file mode 100644 index 000000000..4411e4487 --- /dev/null +++ b/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 diff --git a/pkg/types/doc.go b/pkg/types/doc.go new file mode 100644 index 000000000..04b4c38d1 --- /dev/null +++ b/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 diff --git a/pkg/wait/wait.go b/pkg/wait/wait.go index e8cf073f8..141f24981 100644 --- a/pkg/wait/wait.go +++ b/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 ( diff --git a/pkg/wait/wait_time.go b/pkg/wait/wait_time.go index 99fb3a96c..1ed277084 100644 --- a/pkg/wait/wait_time.go +++ b/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 ( diff --git a/pkg/wait/wait_time_test.go b/pkg/wait/wait_time_test.go index 5f7ad6949..c194600af 100644 --- a/pkg/wait/wait_time_test.go +++ b/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 ( diff --git a/proxy/doc.go b/proxy/doc.go new file mode 100644 index 000000000..181a3e0fa --- /dev/null +++ b/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 diff --git a/raft/rafttest/doc.go b/raft/rafttest/doc.go new file mode 100644 index 000000000..85ef5e7ff --- /dev/null +++ b/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 diff --git a/rafthttp/doc.go b/rafthttp/doc.go new file mode 100644 index 000000000..320f842b8 --- /dev/null +++ b/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 diff --git a/snap/snapshotter.go b/snap/snapshotter.go index dd4fe02af..c80849c97 100644 --- a/snap/snapshotter.go +++ b/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 ( diff --git a/storage/backend/doc.go b/storage/backend/doc.go new file mode 100644 index 000000000..50cd8d5cf --- /dev/null +++ b/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 diff --git a/storage/doc.go b/storage/doc.go new file mode 100644 index 000000000..7de6851c5 --- /dev/null +++ b/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 diff --git a/store/doc.go b/store/doc.go new file mode 100644 index 000000000..08cb924ab --- /dev/null +++ b/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 diff --git a/version/version.go b/version/version.go index 464911f0c..976917e95 100644 --- a/version/version.go +++ b/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 (