Skip to content
Snippets Groups Projects
Programming.md 908 B
Newer Older
  • Learn to ignore specific revisions
  • # Collection of programming stuff
    
    ## Dependencies
    
    * github.com/spf13/cobra: used for basic cli of gosdn, such as starting the daemon, get versioning info etc
    * grpc
    
    Martin Stiemerling's avatar
    Martin Stiemerling committed
    * ygot
    
    
    ## Structure of the code
    
    main.go: main() function
    nucleus/: core functionality of gosdn 
    
    ygot (yang for go tools).
    Checkout this in go: go get github.com/openconfig/ygot/ygot
    
    ## Usefull things to know
    
    Regenerate gRPC code (https://grpc.io/docs/languages/go/quickstart/#regenerate-grpc-code)
    
    * ( cd  ~/go/src/github.com/grpc-go/cmd/protoc-gen-go-grpc/ && go install . )
    *
    protoc \
      --go_out=Mgrpc/service_config/service_config.proto=/internal/proto/grpc_service_config:. \
      --go-grpc_out=Mgrpc/service_config/service_config.proto=/internal/proto/grpc_service_config:. \
      --go_opt=paths=source_relative \
      --go-grpc_opt=paths=source_relative \
    
    Martin Stiemerling's avatar
    Martin Stiemerling committed
      cliInterface/gosdnCLI.proto
      
    Generate the ygot code:
    
    just type: go generate