File1.go
Package abc
type ECA struct {
*CA
obcKey []byte
obcPriv, obcPub []byte
gRPCServer *grpc.Server
}
type ECAP struct {
eca *ECA
}
func (ecap *ECAP) ReadCACertificate(ctx context.Context, in *pb.Empty) (*pb.Cert, error) {
Trace.Println("gRPC ECAP:ReadCACertificate")
return &pb.Cert{Cert: ecap.eca.raw}, nil
}
File2.go
package main
import "abc"
var ecap abc.ECAP //creating instance
func main() {
err = ecap.ReadCACertificate(floo,floo)
}
I am a newbie. I want to create instance of ECAP struct and call ReadCACertificate method. Right now i am creating like this "var ecap abc.ECAP //creating instance" which is giving "nil" and nil pointer error.
Can anyone help how to call the ReadCACertificate method in efficient way.
Thanks in advance.