You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: clapiconsumer.go
    path of file: ./repos/aether-app/aether-core/aether/frontend/clapiconsumer
    
    the code of the file until where you have to start completion: // Frontend > ClientAPI Client
// This package is the client side of the Client's GRPC API. This is the API frontend uses to send the client some frontend health related information, updates, etc.

package clapiconsumer

import (
	"aether-core/aether/frontend/festructs"
	"aether-core/aether/frontend/kvstore"
	"aether-core/aether/io/api"
	pb "aether-core/aether/protos/clapi"
	"aether-core/aether/protos/feobjects"
	"aether-core/aether/services/globals"
	"aether-core/aether/services/logging"
	"aether-core/aether/services/toolbox"
	// "aether-core/aether/services/scheduling"
	// "aether-core/aether/services/toolbox"
	"encoding/json"
	"fmt"
	"golang.org/x/net/context"
	"google.golan
    
func SendNewView() {
	logging.Logf(1, "SendNewView is called")
	c, conn := StartClientAPIConnection()
	defer conn.Close()
	ctx, cancel := context.WithTimeout(context.Background(), globals.FrontendConfig.GetGRPCServiceTimeout())
	defer cancel()
	nvc := festructs.NewViewCarrier{}
	logging.Logf(3, "Single read happens in SendNewView>One")
	err := globals.KvInstance.One("Id", 1, &nvc)
	if err != nil {
		logging.Logf(1, "New view fetch in SendNewView encountered an error. Error: %v", err)
		return
	}
	thrs := []*feobjects.CompiledThreadEntity{}
	for k, _ := range nvc.Threads {
		protoEntity := nvc.Threads[k].Protobuf()
		// Get board name for thread
		ab := festructs.AmbientBoard{}
		logging.Logf(3, "Single read happens in SendNewView>One>Post>Board")
		err := globals.KvInstance.One("Fingerprint", protoEntity.GetBoard(), &ab)
		if err != nil {
			logging.Logf(1, "Trying to get the parent board of this post in the search results errored out #1. Error: %v ProtoEntity: %#v", err, *protoEntity)
			continue
		}
		protoEntity.ViewMeta_BoardName = ab.Name
		thrs = append(thrs, protoEntity)
	}
	psts := []*feobjects.CompiledPostEntity{}
	for k, _ := range nvc.Posts {
		protoEntity := nvc.Posts[k].Protobuf()
		// Get board name for post
		ab := festructs.AmbientBoard{}
		logging.Logf(3, "Single read happens in SendNewView>One>Post>Board")
		err := globals.KvInstance.One("Fingerprint", protoEntity.GetBoard(), &ab)
		if err != nil {
			logging.Logf(1, "Trying to get the parent board of this post in the search results errored out #2. Error: %v ProtoEntity: %#v", err, *protoEntity)
			continue
		}
		protoEntity.ViewMeta_BoardName = ab.Name
		// Get thread name for post
		tc := festructs.ThreadCarrier{}
		logging.Logf(3, "Single read happens in SendNewView>One>Post>Thread")
		err2 := globals.KvInstance.One("Fingerprint", protoEntity.GetThread(), &tc)
		if err2 != nil {
			logging.Logf(1, "Trying to get the parent thread of this post in the search results errored out. Error: %v", err2)
			continue
		}
		protoEntity.ViewMeta_ThreadName = tc.Threads[0].Name
		psts = append(psts, protoEntity)
	}
	nvp := pb.NewViewPayload{
		Threads: thrs,
		Posts:   psts,
	}
	_, err2 := c.SendNewView(ctx, &nvp)
	if err2 != nil {
		logging.Logf(1, "SendNewView encountered an error. Err: %v", err2)
	}
}