chipingressset

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: MIT Imports: 19 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DEFAULT_STACK_NAME = "chip-ingress"

	DEFAULT_CHIP_INGRESS_GRPC_PORT    = "50051"
	DEFAULT_CHIP_INGRESS_SERVICE_NAME = "chip-ingress"

	DEFAULT_RED_PANDA_SCHEMA_REGISTRY_PORT = "18081"
	DEFAULT_RED_PANDA_KAFKA_PORT           = "19092"
	DEFAULT_RED_PANDA_SERVICE_NAME         = "redpanda-0"

	DEFAULT_RED_PANDA_CONSOLE_SERVICE_NAME = "redpanda-console"
	DEFAULT_RED_PANDA_CONSOLE_PORT         = "8080"
)

Variables

View Source
var DefaultRepositoryToSubjectNamingStrategy = RepositoryToSubjectNamingStrategyFn{
	"smartcontractkit/chainlink-protos": ChainlinkProtosSubjectNamingStrategy,
}

DefaultRepositoryToSubjectNamingStrategy is a map of repository names to SubjectNamingStrategyFn functions

Functions

func ChainlinkProtosSubjectNamingStrategy

func ChainlinkProtosSubjectNamingStrategy(path, source string, protoSchemaSet ProtoSchemaSet) (string, error)

TODO once we have single source of truth for the relationship between protos and subjects, we need to modify this function

func CreateTopics

func CreateTopics(ctx context.Context, kafkaAddress string, topics []string) error

func DefaultRegisterAndFetchProtos

func DefaultRegisterAndFetchProtos(ctx context.Context, client *github.Client, protoSchemaSets []ProtoSchemaSet, schemaRegistryURL string) error

func DefaultSubjectNamingStrategy

func DefaultSubjectNamingStrategy(path, source string, protoSchemaSet ProtoSchemaSet) (string, error)

func DeleteAllTopics

func DeleteAllTopics(ctx context.Context, kafkaAddress string) error

func RegisterAndFetchProtos

func RegisterAndFetchProtos(ctx context.Context, client *github.Client, protoSchemaSets []ProtoSchemaSet, schemaRegistryURL string, repoToSubjectNamingStrategy RepositoryToSubjectNamingStrategyFn) error

func ValidateRepoConfiguration

func ValidateRepoConfiguration(repoConfig ProtoSchemaSet) error

Types

type ChipIngressOutput

type ChipIngressOutput struct {
	GRPCInternalURL string
	GRPCExternalURL string
}

type Input

type Input struct {
	ComposeFile         string   `toml:"compose_file"`
	ExtraDockerNetworks []string `toml:"extra_docker_networks"`
	Output              *Output  `toml:"output"`
	UseCache            bool     `toml:"use_cache"`
}

type Output

type Output struct {
	ChipIngress *ChipIngressOutput
	RedPanda    *RedPandaOutput
}

func New

func New(in *Input) (*Output, error)

type ProtoSchemaSet

type ProtoSchemaSet struct {
	Owner      string   `toml:"owner"`
	Repository string   `toml:"repository"`
	Ref        string   `toml:"ref"`     // ref or tag or commit SHA
	Folders    []string `toml:"folders"` // if not provided, all protos will be fetched, otherwise only protos in these folders will be fetched
}

type RedPandaOutput

type RedPandaOutput struct {
	SchemaRegistryInternalURL string
	SchemaRegistryExternalURL string
	KafkaInternalURL          string
	KafkaExternalURL          string
	ConsoleExternalURL        string
}

type RepositoryToSubjectNamingStrategyFn

type RepositoryToSubjectNamingStrategyFn map[string]SubjectNamingStrategyFn

RepositoryToSubjectNamingStrategyFn is a map of repository names to SubjectNamingStrategyFn functions

type SubjectNamingStrategyFn

type SubjectNamingStrategyFn func(path, source string, repoConfig ProtoSchemaSet) (string, error)

SubjectNamingStrategyFn is a function that is used to determine the subject name for a given proto file in a given repo

Jump to

Keyboard shortcuts

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