Documentation ¶
Overview ¶
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.
Index ¶
- func CreateTestService(addr string, debug bool) (hostAddr ma.Multiaddr, gRPCAddr ma.Multiaddr, stop func(), err error)
- type Config
- type Service
- func (s *Service) AddRecord(ctx context.Context, req *pb.AddRecordRequest) (*pb.AddRecordReply, error)
- func (s *Service) AddReplicator(ctx context.Context, req *pb.AddReplicatorRequest) (*pb.AddReplicatorReply, error)
- func (s *Service) AddThread(ctx context.Context, req *pb.AddThreadRequest) (*pb.ThreadInfoReply, error)
- func (s *Service) CreateRecord(ctx context.Context, req *pb.CreateRecordRequest) (*pb.NewRecordReply, error)
- func (s *Service) CreateThread(ctx context.Context, req *pb.CreateThreadRequest) (*pb.ThreadInfoReply, error)
- func (s *Service) DeleteThread(ctx context.Context, req *pb.DeleteThreadRequest) (*pb.DeleteThreadReply, error)
- func (s *Service) GetHostID(_ context.Context, _ *pb.GetHostIDRequest) (*pb.GetHostIDReply, error)
- func (s *Service) GetRecord(ctx context.Context, req *pb.GetRecordRequest) (*pb.GetRecordReply, error)
- func (s *Service) GetThread(ctx context.Context, req *pb.GetThreadRequest) (*pb.ThreadInfoReply, error)
- func (s *Service) GetToken(server pb.API_GetTokenServer) error
- func (s *Service) PullThread(ctx context.Context, req *pb.PullThreadRequest) (*pb.PullThreadReply, error)
- func (s *Service) Subscribe(req *pb.SubscribeRequest, server pb.API_SubscribeServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTestService ¶
func CreateTestService(addr string, debug bool) (hostAddr ma.Multiaddr, gRPCAddr ma.Multiaddr, stop func(), err error)
CreateTestService creates a test network API gRPC service for test purpose. It uses either the addr passed in as host addr, or pick an available local addr if it is empty
Types ¶
type Service ¶
type Service struct { pb.UnimplementedAPIServer // contains filtered or unexported fields }
Service is a gRPC service for a thread network.
func NewService ¶
NewService starts and returns a new service.
func (*Service) AddRecord ¶
func (s *Service) AddRecord(ctx context.Context, req *pb.AddRecordRequest) (*pb.AddRecordReply, error)
func (*Service) AddReplicator ¶
func (s *Service) AddReplicator(ctx context.Context, req *pb.AddReplicatorRequest) (*pb.AddReplicatorReply, error)
func (*Service) AddThread ¶
func (s *Service) AddThread(ctx context.Context, req *pb.AddThreadRequest) (*pb.ThreadInfoReply, error)
func (*Service) CreateRecord ¶
func (s *Service) CreateRecord(ctx context.Context, req *pb.CreateRecordRequest) (*pb.NewRecordReply, error)
func (*Service) CreateThread ¶
func (s *Service) CreateThread(ctx context.Context, req *pb.CreateThreadRequest) (*pb.ThreadInfoReply, error)
func (*Service) DeleteThread ¶
func (s *Service) DeleteThread(ctx context.Context, req *pb.DeleteThreadRequest) (*pb.DeleteThreadReply, error)
func (*Service) GetHostID ¶
func (s *Service) GetHostID(_ context.Context, _ *pb.GetHostIDRequest) (*pb.GetHostIDReply, error)
func (*Service) GetRecord ¶
func (s *Service) GetRecord(ctx context.Context, req *pb.GetRecordRequest) (*pb.GetRecordReply, error)
func (*Service) GetThread ¶
func (s *Service) GetThread(ctx context.Context, req *pb.GetThreadRequest) (*pb.ThreadInfoReply, error)
func (*Service) PullThread ¶
func (s *Service) PullThread(ctx context.Context, req *pb.PullThreadRequest) (*pb.PullThreadReply, error)
func (*Service) Subscribe ¶
func (s *Service) Subscribe(req *pb.SubscribeRequest, server pb.API_SubscribeServer) error
Click to show internal directories.
Click to hide internal directories.