Skip to content

Commit

Permalink
missing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
raskle committed Apr 25, 2017
1 parent 66496a7 commit 3512dd4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func NewHandler() *Handler {
return handler
}

// NewRouter creates a Gorilla Mus http router
func NewRouter(handler *Handler) *mux.Router {
router := mux.NewRouter()
router.HandleFunc("/index", handler.handleGetIndexes).Methods("GET")
Expand Down Expand Up @@ -1315,6 +1316,7 @@ type QueryResponse struct {
Err error
}

// MarshalJSON marshals QueryResponse into a JSON-encoded byte slice
func (resp *QueryResponse) MarshalJSON() ([]byte, error) {
var output struct {
Results []interface{} `json:"results,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion holder.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ type HolderSyncer struct {
Closing <-chan struct{}
}

// Returns true if the syncer has been marked to close.
// IsClosing returns true if the syncer has been marked to close.
func (s *HolderSyncer) IsClosing() bool {
select {
case <-s.Closing:
Expand Down
2 changes: 2 additions & 0 deletions index.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ func (i *Index) MaxSlice() uint64 {
return max
}

// SetRemoteMaxSlice sets the remote max slice value received from another node
func (i *Index) SetRemoteMaxSlice(newmax uint64) {
i.mu.Lock()
defer i.mu.Unlock()
Expand All @@ -273,6 +274,7 @@ func (i *Index) MaxInverseSlice() uint64 {
return max
}

// SetRemoteMaxInverseSlice sets the remote max inverse slice value received from another node
func (i *Index) SetRemoteMaxInverseSlice(v uint64) {
i.mu.Lock()
defer i.mu.Unlock()
Expand Down
2 changes: 1 addition & 1 deletion pilosa.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func decodeColumnAttrSet(pb *internal.ColumnAttrSet) *ColumnAttrSet {
// TimeFormat is the go-style time format used to parse string dates.
const TimeFormat = "2006-01-02T15:04"

// Restrict name using regex
// ValidateName restrict name using regex
func ValidateName(name string) error {
validName := nameRegexp.Match([]byte(name))
if validName == false {
Expand Down
4 changes: 2 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,13 @@ func (s *Server) ReceiveMessage(pb proto.Message) error {
return nil
}

// Server implements StatusHandler.
// LocalStatus returns the state of the local node as well as the
// holder (indexes/frames) according to the local node.
// In a gossip implementation, memberlist.Delegate.LocalState() uses this.
// Server implements StatusHandler.
func (s *Server) LocalStatus() (proto.Message, error) {
if s.Holder == nil {
return nil, errors.New("Server.Holder is nil.")
return nil, errors.New("Server.Holder is nil")
}
return &internal.NodeStatus{
Host: s.Host,
Expand Down
4 changes: 2 additions & 2 deletions stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func init() {
NopStatsClient = &nopStatsClient{}
}

// Global expvar.
// Expvar Global expvar map.
var Expvar = expvar.NewMap("index")

// StatsClient represents a client to a stats server.
Expand All @@ -39,9 +39,9 @@ type StatsClient interface {
Timing(name string, value time.Duration)
}

// NopStatsClient represents a client that doesn't do anything.
var NopStatsClient StatsClient

// nopStatsClient represents a client that doesn't do anything.
type nopStatsClient struct{}

func (c *nopStatsClient) Tags() []string { return nil }
Expand Down

0 comments on commit 3512dd4

Please sign in to comment.