...

Package utils

import "edge-infra.dev/hack/tools/hr/utils"
Overview
Index

Overview ▾

Constants

const (
    LongHelp = `
CLI program to create helm workloads in sql db from what is in big query.

The cli program can be run like so:

hr --databaseHost=localhost --databaseName=dev0 --databaseUser=postgres --databasePassword=**** 
--bigQueryTableName='ret-edge-dev0-foreman.ctlfishpubsub.resources' --gcpSA=path

The following flags are required for the cli to run:
databaseHost, databaseName, databaseUser, bigQueryTableName gcpSA

database password is optional and will use iam auth if not provided

The dryRun flag is an optional and defaults to false if not specified. launchdarklyKey is also an optional flag that defaults to using cluster id if not set.`
)

type HRCommand

type HRCommand struct {
    DBConnection *sql.DB
    BQClient     clients.BQClient
}

func New

func New() *HRCommand

func (HRCommand) Exec

func (e HRCommand) Exec(name, shortUsage, shortHelp string, bqTableName string, callback func(ctx context.Context, db *sql.DB, BQClient clients.BQClient, bqTableName string, clusterEdgeID string) bool, fs *flag.FlagSet) *ffcli.Command

func (*HRCommand) SetBQClient

func (e *HRCommand) SetBQClient(db clients.BQClient) *HRCommand

func (*HRCommand) SetDBConnection

func (e *HRCommand) SetDBConnection(db *sql.DB) *HRCommand