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: ad_ctr.go
    path of file: ./repos/risingwave/integration_tests/datagen/ad_ctr
    
    the code of the file until where you have to start completion: package ad_ctr

import (
	"context"
	"datagen/gen"
	"datagen/sink"
	"encoding/json"
	"fmt"
	"strconv"
	"time"

	"github.com/brianvoe/gofakeit/v6"
)

type adImpressionEvent struct {
	sink.BaseSinkRecord

	BidId               int64  `json:"bid_id"`
	AdId                int64  `json:"ad_id"`
	ImpressionTimestamp string `json:"impression_t
    
func (g *adCtrGen) generate() []sink.SinkRecord {
	bidId, _ := strconv.ParseInt(g.faker.DigitN(8), 10, 64)
	adId := int64(g.faker.IntRange(1, 10))

	events := []sink.SinkRecord{
		&adImpressionEvent{
			BidId:               bidId,
			AdId:                adId,
			ImpressionTimestamp: time.Now().Format(gen.RwTimestamptzLayout),
		},
	}
	if g.hasClick(adId) {
		randomDelay := time.Duration(g.faker.IntRange(1, 10) * int(time.Second))
		events = append(events, &adClickEvent{
			BidId:          bidId,
			ClickTimestamp: time.Now().Add(randomDelay).Format(gen.RwTimestamptzLayout),
		})
	}
	return events
}