data

package
v5.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: AGPL-3.0 Imports: 45 Imported by: 0

Documentation

Overview

Package data is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var WireData = wire.NewSet(NewData)

Functions

func InitDB

func InitDB(drv dialect.Driver, logger mlog.Logger, slogLogEnabled bool, slowLogThreshold time.Duration, timer timer.Timer) (*ent.Client, error)

func NewSqliteDB

func NewSqliteDB() (*ent.Client, error)

func OpenDB

func OpenDB(config *config.Config) (*sql.Driver, error)

Types

type Data

type Data interface {
	Config() *config.Config
	DB() *ent.Client
	MinioCli() *minio.Client
	K8sClient() *K8sClient
	OidcConfig() OidcConfig

	InitDB() (func() error, error)
	InitS3() error
	InitK8s(ch <-chan struct{}) (err error)
	InitOidcProvider()

	WithTx(ctx context.Context, fn func(tx *ent.Tx) error) error
}

func NewData

func NewData(cfg *config.Config, logger mlog.Logger) Data

func NewDataImpl

func NewDataImpl(input *NewDataParams) Data

type FanOutInterface

type FanOutInterface[T runtime2.Object] interface {
	RemoveListener(key string)
	AddListener(key string, ch chan Obj[T])
	Distribute(done <-chan struct{})
	RemoveAll()
}

func NewFanOut

func NewFanOut[T runtime2.Object](
	logger mlog.Logger,
	name string,
	ch chan Obj[T],
	listeners map[string]chan<- Obj[T],
) FanOutInterface[T]

type FanOutType

type FanOutType int
const (
	Add FanOutType = iota
	Update
	Delete
)

type K8sClient

type K8sClient struct {
	GatewayApiInstalled bool
	HTTPRouteLister     gatewaylisterv1.HTTPRouteLister

	Client        kubernetes.Interface
	MetricsClient versioned.Interface
	RestConfig    *restclient.Config

	PodInformer cache.SharedIndexInformer
	PodLister   v1.PodLister

	SecretInformer cache.SharedIndexInformer
	SecretLister   v1.SecretLister

	ReplicaSetLister appsv1.ReplicaSetLister
	ServiceLister    v1.ServiceLister
	IngressLister    networkingv1.IngressLister

	EventInformer cache.SharedIndexInformer

	EventFanOut FanOutInterface[*eventsv1.Event]
	PodFanOut   FanOutInterface[*corev1.Pod]
	EventLister eventsv1lister.EventLister
	// contains filtered or unexported fields
}

type MockData

type MockData struct {
	// contains filtered or unexported fields
}

MockData is a mock of Data interface.

func NewMockData

func NewMockData(ctrl *gomock.Controller) *MockData

NewMockData creates a new mock instance.

func (*MockData) Config

func (m *MockData) Config() *config.Config

Config mocks base method.

func (*MockData) DB

func (m *MockData) DB() *ent.Client

DB mocks base method.

func (*MockData) EXPECT

func (m *MockData) EXPECT() *MockDataMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockData) InitDB

func (m *MockData) InitDB() (func() error, error)

InitDB mocks base method.

func (*MockData) InitK8s

func (m *MockData) InitK8s(arg0 <-chan struct{}) error

InitK8s mocks base method.

func (*MockData) InitOidcProvider

func (m *MockData) InitOidcProvider()

InitOidcProvider mocks base method.

func (*MockData) InitS3

func (m *MockData) InitS3() error

InitS3 mocks base method.

func (*MockData) K8sClient

func (m *MockData) K8sClient() *K8sClient

K8sClient mocks base method.

func (*MockData) MinioCli

func (m *MockData) MinioCli() *minio.Client

MinioCli mocks base method.

func (*MockData) OidcConfig

func (m *MockData) OidcConfig() OidcConfig

OidcConfig mocks base method.

func (*MockData) WithTx

func (m *MockData) WithTx(arg0 context.Context, arg1 func(*ent.Tx) error) error

WithTx mocks base method.

type MockDataMockRecorder

type MockDataMockRecorder struct {
	// contains filtered or unexported fields
}

MockDataMockRecorder is the mock recorder for MockData.

func (*MockDataMockRecorder) Config

func (mr *MockDataMockRecorder) Config() *gomock.Call

Config indicates an expected call of Config.

func (*MockDataMockRecorder) DB

func (mr *MockDataMockRecorder) DB() *gomock.Call

DB indicates an expected call of DB.

func (*MockDataMockRecorder) InitDB

func (mr *MockDataMockRecorder) InitDB() *gomock.Call

InitDB indicates an expected call of InitDB.

func (*MockDataMockRecorder) InitK8s

func (mr *MockDataMockRecorder) InitK8s(arg0 any) *gomock.Call

InitK8s indicates an expected call of InitK8s.

func (*MockDataMockRecorder) InitOidcProvider

func (mr *MockDataMockRecorder) InitOidcProvider() *gomock.Call

InitOidcProvider indicates an expected call of InitOidcProvider.

func (*MockDataMockRecorder) InitS3

func (mr *MockDataMockRecorder) InitS3() *gomock.Call

InitS3 indicates an expected call of InitS3.

func (*MockDataMockRecorder) K8sClient

func (mr *MockDataMockRecorder) K8sClient() *gomock.Call

K8sClient indicates an expected call of K8sClient.

func (*MockDataMockRecorder) MinioCli

func (mr *MockDataMockRecorder) MinioCli() *gomock.Call

MinioCli indicates an expected call of MinioCli.

func (*MockDataMockRecorder) OidcConfig

func (mr *MockDataMockRecorder) OidcConfig() *gomock.Call

OidcConfig indicates an expected call of OidcConfig.

func (*MockDataMockRecorder) WithTx

func (mr *MockDataMockRecorder) WithTx(arg0, arg1 any) *gomock.Call

WithTx indicates an expected call of WithTx.

type NewDataParams

type NewDataParams struct {
	Cfg       *config.Config
	Oidc      OidcConfig
	DB        *ent.Client
	MinioCli  *minio.Client
	K8sClient *K8sClient
	Logger    mlog.Logger
}

type Obj

type Obj[T runtime2.Object] interface {
	Type() FanOutType
	Old() T
	Current() T
}

func NewObj

func NewObj[T runtime2.Object](old T, current T, t FanOutType) Obj[T]

type OidcConfig

type OidcConfig map[string]OidcConfigItem

type OidcConfigItem

type OidcConfigItem struct {
	Provider           *oidc.Provider
	Config             oauth2.Config
	EndSessionEndpoint string
}

type Startable

type Startable struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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