Skip to content

Commit

Permalink
add a few package docs
Browse files Browse the repository at this point in the history
Signed-off-by: Merlin Ran <[email protected]>
  • Loading branch information
merlinran committed May 11, 2021
1 parent 674183c commit 5d09258
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion api/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package api is all about the DB API. It contains the protobuf definition (under /pb), a Go client (under /client) and a gRPC service for the API backed by the actual DB manager.
package api

import (
Expand Down Expand Up @@ -27,7 +28,7 @@ var (
log = logging.Logger("threadsapi")
)

// Service is a gRPC service for a DB manager.
// Service is a gRPC DB API service backed by a DB manager.
type Service struct {
manager *db.Manager
}
Expand Down Expand Up @@ -61,6 +62,7 @@ func (s *Service) Close() error {
return s.manager.Close()
}

// remoteIdentity implements core.thread.Identify.
type remoteIdentity struct {
pk thread.PubKey
server pb.API_GetTokenServer
Expand Down
3 changes: 2 additions & 1 deletion cbor/record.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package cbor provides utilities to create or convert data to and from CBOR format (https://cbor.io/).
package cbor

import (
Expand Down Expand Up @@ -142,7 +143,7 @@ func RecordToProto(ctx context.Context, dag format.DAGService, rec net.Record) (
}, nil
}

// Unmarshal returns a node from a serialized version that contains link data.
// RecordFromProto returns a node from a serialized version that contains link data.
func RecordFromProto(rec *pb.Log_Record, key crypto.DecryptionKey) (net.Record, error) {
if key == nil {
return nil, fmt.Errorf("decryption key is required")
Expand Down
1 change: 1 addition & 0 deletions common/common.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package common provides utilities to set network options.
package common

import (
Expand Down
2 changes: 2 additions & 0 deletions core/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package core defines the core types, constants, data structures and interfaces for go-threads.
package core
1 change: 1 addition & 0 deletions logstore/logstore.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//Package logstore provides local store for thread logs. The subpackages provide creators for different types of store implementations.
package logstore

import (
Expand Down
1 change: 1 addition & 0 deletions net/api/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package api is all about the Network API. It contains the protobuf definition (under /pb), a Go client (under /client) and a gRPC service for the API backed by the threads network.
package api

import (
Expand Down
3 changes: 2 additions & 1 deletion net/net.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//Package net implements the network layer for go-threads. Nodes exchange messages with each other via gRPC, and the format is defined under /pb.
package net

import (
Expand Down Expand Up @@ -87,7 +88,7 @@ func (t semaThreadUpdate) Key() string {
return "tu:" + string(t)
}

// net is an implementation of core.DBNet.
// net is an implementation of app.Net.
type net struct {
format.DAGService
host host.Host
Expand Down

0 comments on commit 5d09258

Please sign in to comment.