utils

package
v0.0.0-...-27b6213 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureOPALClient

func ConfigureOPALClient(opalClientConfig *OPALClientConfig) ([]byte, error)

func InitPostgres

func InitPostgres(
	postgresHost string,
	postgresPort string,
	postgresDB string,
	postgresUser string,
	postgresPassword string) *pgxpool.Pool

func VerifyJWTTokenAndExtractOPALClientID

func VerifyJWTTokenAndExtractOPALClientID(tokenString string) (string, error)

Types

type Config

type Config struct {
	AppEnv                string
	Port                  string
	ShouldEnableServerTLS string
	ConfigLoaderCertPath  string
	ConfigLoaderKeyPath   string
	OPALAuthPublicKeyPath string
	OPALServerHost        string
	OPALServerPort        string
	OPALClientToken       string
	PostgresHost          string
	PostgresPort          string
	PostgresDB            string
	PostgresUser          string
	PostgresPassword      string
}

func GetConfig

func GetConfig() *Config

type Entry

type Entry struct {
	URL     string      `json:"url"`
	Config  EntryConfig `json:"config"`
	Topics  []string    `json:"topics"`
	DstPath string      `json:"dst_path"`
}

type EntryConfig

type EntryConfig struct {
	Fetcher          string                      `json:"fetcher"`
	Query            string                      `json:"query"`
	ConnectionParams EntryConfigConnectionParams `json:"connection_params"`
	DictKey          string                      `json:"dict_key"`
}

type EntryConfigConnectionParams

type EntryConfigConnectionParams struct {
	Password string `json:"password"`
}

type JWTTokenContent

type JWTTokenContent struct {
	ID string
}

type OPALClient

type OPALClient struct {
	OPALClientID string
	Config       string
}

type OPALClientConfig

type OPALClientConfig struct {
	Entries []Entry `json:"entries"`
}

func FetchOPALClientConfig

func FetchOPALClientConfig(pg *pgxpool.Pool, opalClientID string) (*OPALClientConfig, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL