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: caching.go
    path of file: ./repos/aether-app/aether-core/aether/frontend/beapiconsumer
    
    the code of the file until where you have to start completion: package beapiconsumer

import (
	"aether-core/aether/protos/mimapi"
	"aether-core/aether/services/globals"
	"aether-core/aether/services/logging"
	"aether-core/aether/services/toolbox"
	"sort"
	// "fmt"
	"time"
)

/*================================================
=            Internal cache structure            =
================================================*/

// This is not publicly accessible directly.

type backendAPICache struct {
	Boards                []*mimapi.Board
	Threads               []*mimapi.Thread
	Posts                 []*mimapi.Post
	Votes                 []*mimapi.Vote
	Keys                  []*mimapi.Key
	Truststates           []*mimapi.Truststate
	Prefilled             bool
	PrefillStartTimestamp int64
	PrefillE
    
func PrefillCache(lastRef int64) int64 {
	start := time.Now()
	cache.PrefillStartTimestamp = lastRef
	cache.PrefillEndTimestamp = time.Now().Unix()
	cache.Boards = GetBoards(
		cache.PrefillStartTimestamp,
		cache.PrefillEndTimestamp, []string{},
		true, true)
	cache.Threads = GetThreads(
		cache.PrefillStartTimestamp,
		cache.PrefillEndTimestamp, []string{}, "",
		true, true)
	cache.Posts = GetPosts(
		cache.PrefillStartTimestamp,
		cache.PrefillEndTimestamp, []string{}, "", "",
		true, true)
	cache.Votes = GetVotes(
		cache.PrefillStartTimestamp,
		cache.PrefillEndTimestamp, []string{}, "", "", "", -1, -1, false,
		true, true)
	cache.Keys = GetKeys(
		cache.PrefillStartTimestamp,
		cache.PrefillEndTimestamp, []string{},
		true, true)
	cache.Truststates = GetTruststates(
		cache.PrefillStartTimestamp,
		cache.PrefillEndTimestamp, []string{}, -1, -1, "", "",
		true, true)
	cache.Prefilled = true
	elapsed := time.Since(start)
	logging.Logf(1, "Cache is prefilled in %s and ready. Boards: %v, Threads, %v, Posts: %v, Votes: %v, Keys: %v, Truststates: %v", elapsed, len(cache.Boards), len(cache.Threads), len(cache.Posts), len(cache.Votes), len(cache.Keys), len(cache.Truststates))
	return cache.PrefillEndTimestamp // the refresh cycle should use this as now, so that the time range matches. Otherwise, there might be gaps.
}