package
0.0.0-20200908121219-59ab1726560d
Repository: https://github.com/cryptomood/api.git
Documentation: pkg.go.dev

# README

Cryptomood b2b client - golang

Client example

  1. When connecting to the server use x509 cert.pem file located in certs directory. You won't be able to access the server without it

  2. Make sure you have at least the latest stable version of Golang

  3. (optional) install protoc tool and protoc-gen-go

  4. (optional) transpile proto file to *.go file with protoc -I .. -I $GOPATH/src --go_out=plugins=grpc:./ ../types.proto This will generate transpiled file into current directory. To adhere golang conventions and also to make these examples work, compiler should be able to find this file. Otherwise put it into your GOPATH directory ($GOPATH/src/types) and then just import it like import types.

    Steps 3-4 are optional, because this directory already contains prepared types.pb.go file

  5. Load credentials

    creds, err := credentials.NewClientTLSFromFile(CertFile, "")
    
  6. Dial the server. You must provide your api token (to obtain it visit our website) to authorize your requests

    conn, err := grpc.Dial(Server, grpc.WithTransportCredentials(creds), grpc.WithPerRPCCredentials(tokenAuth{Token}), grpc.WithTimeout(5*time.Second), grpc.WithBlock())
    
  7. Initialize required service and call required method (in this case subscription)

    proxyClient := types.NewMessagesProxyClient(conn)
    sub, err := proxyClient.SubscribeTweet(context.Background(), &empty.Empty{})
    
  8. Read data indefinitely

    for {
    		msg, err := sub.Recv()
    		if err == io.EOF {
    			continue
    		}
    		if sub.Context().Err() != nil {
    			_ = sub.CloseSend()
    			fmt.Println("Closing connection to server")
    			break
    		}
    		fmt.Println(msg.Base.Content, err)
    	}
    

For full example, see any example directory.

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
Article
*Basic model for News, articles.It's weight depends on Alexa ranks.
*Represent one asset.
No description provided by the author
No description provided by the author
*Base model for messages or news, contains basic data like title, content, source, published date etc..
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
*Each request for historic data should be limited by date.
*Groups all types of named entities we support.
*Occurrence od named entity.contains position, matched text, category.
No description provided by the author
additional fields to public model.
*Sentiment message holds informations about aggregated sentiment for specific time window.It is emitted every second for each asset and resolution.
*Each request for historic data should be limited by date.
*Group data that refers to sentiment of message.
No description provided by the author
UnimplementedDatasetServer can be embedded to have forward compatible implementations.
UnimplementedHistoricDataServer can be embedded to have forward compatible implementations.
UnimplementedMessagesProxyServer can be embedded to have forward compatible implementations.
UnimplementedSentimentsServer can be embedded to have forward compatible implementations.
*Basic model for media where the messages are wrote by regular user.

# Interfaces

DatasetClient is the client API for Dataset service.
DatasetServer is the server API for Dataset service.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
HistoricDataClient is the client API for HistoricData service.
HistoricDataServer is the server API for HistoricData service.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MessagesProxyClient is the client API for MessagesProxy service.
MessagesProxyServer is the server API for MessagesProxy service.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SentimentsClient is the client API for Sentiments service.
SentimentsServer is the server API for Sentiments service.

# Type aliases

*Types of named entities.