dbinstance

package
v0.0.1-20220720-0002 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance struct {

	// Define the callback in case of missing instance
	OnMissingAutoCreate OnMissingAutoCreate
	// contains filtered or unexported fields
}

func NewInstance

func NewInstance() *Instance

func (*Instance) GetClientByInstanceId

func (i *Instance) GetClientByInstanceId(
	instanceName string,
) (*gorm.DB, error)

GetClientByInstanceId - returns an existing/saved instance

func (*Instance) SaveClientToInstances

func (i *Instance) SaveClientToInstances(
	instanceName string,
	client *gorm.DB,
)

type OnMissingAutoCreate

type OnMissingAutoCreate func(instanceName string) (*gorm.DB, error)

Jump to

Keyboard shortcuts

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