lime

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMax

func GetMax(db *gorm.DB, column string) (uint, error)

Types

type Lime

type Lime struct {
	ParamDB  *util.ConfigDB
	DB       *gorm.DB
	Limetool *limetool.Lime
}

func NewLime

func NewLime(PDB *util.ConfigDB) *Lime

func (*Lime) SaveContact

func (lime *Lime) SaveContact(row *models.Contact) error

SaveContact upserts a contact matched by (source, source_id) rather than by factum ID - same reason as SaveCustomer. NotifyMaintenance is factum-owned (the operator toggle on the contacts page, including for Lime-synced rows) so a resync must not reset it; new Lime persons default it to false so they are not mailed until an operator opts them in.

func (*Lime) SaveCustomer

func (lime *Lime) SaveCustomer(row *models.Customer) error

SaveCustomer upserts a customer matched by (source, source_id) rather than by factum ID - the factum ID is autogenerated (see SyncCustomers) so it can't be used to find a previously-synced row. Lime-owned fields are copied onto the existing row so a resync does not zero CreatedAt (GORM Save writes the whole struct, including zero timestamps).

func (*Lime) SaveDelivery

func (lime *Lime) SaveDelivery(row *models.Service) error

SaveDelivery upserts a service matched by (source, source_id) rather than by factum ID - the factum ID is autogenerated (see SyncCustomers) so it can't be used to find a previously-synced row.

Lime never feeds ServiceType/BandwidthMbps/MaxMacAddresses, Fields, PseudowireID, L2VPNNetboxID or connection_type_id - those are only ever set from the factum side. Overlaying Lime-owned fields onto the stored row (instead of Save() of a fresh struct) keeps a resync from wiping that enrichment and from zeroing CreatedAt. service_endpoints is a separate table and is not touched.

func (*Lime) SyncCustomers

func (lime *Lime) SyncCustomers(companyNames []string, refresh bool, reporter jobevent.Reporter) error

Fetch data from LIME, store in factum database If refresh is true, refresh data in cache

Jump to

Keyboard shortcuts

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