simple WIP example

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2017-10-12 14:34:46 -04:00
parent 61b81742d3
commit 7988580154
Signed by: vbatts
GPG key ID: 10937E57733F1362

26
main_example.go Normal file
View file

@ -0,0 +1,26 @@
package main
import (
"context"
"time"
"git.thisco.de/vbatts/cri"
"github.com/sirupsen/logrus"
pb "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
)
func main() {
conn, err := cri.GetClientConn("/var/run/crio.sock", time.Minute*15)
if err != nil {
logrus.Fatal(err)
}
ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond)
defer cancel()
imageClient := cri.NewImageServiceClient(conn)
_ = imageClient
_ = ctx
req := &pb.PullImageRequest{}
imageClient.PullImage(ctx, req)
}