repository

package
v0.0.0-...-5e9dbd4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDeviceRepository

func NewDeviceRepository(db *gorm.DB) *deviceRepository

func NewInterfaceRepository

func NewInterfaceRepository(db *gorm.DB) *interfaceRepository

func NewLocationRepository

func NewLocationRepository(db *gorm.DB) *locationRepository

func NewTrafficRepository

func NewTrafficRepository(db *gorm.DB) *trafficRepository

Types

type DeviceRepository

type DeviceRepository interface {
	Add(ctx context.Context, device *entity.Device) error
	Check(ctx context.Context, device *entity.Device) error
	GetByID(ctx context.Context, id uint) (*entity.Device, error)
	GetAll(ctx context.Context) ([]*entity.Device, error)
	GetDevicesWithTemplate(ctx context.Context) ([]*entity.Device, error)
	Update(ctx context.Context, device *entity.Device) error
	Delete(ctx context.Context, id uint) error
}

type InterfaceRepository

type InterfaceRepository interface {
	Get(ctx context.Context, id uint) (*entity.Interface, error)
	Upsert(ctx context.Context, element *entity.Interface) error
	GetAll(ctx context.Context) ([]*entity.Interface, error)
	GetAllByDevice(ctx context.Context, id uint) ([]*entity.Interface, error)
}

type LocationRepository

type LocationRepository interface {
	Add(ctx context.Context, location *entity.Location) error
	Find(ctx context.Context, location *entity.Location) error
}

type TrafficRepository

type TrafficRepository interface {
	Add(ctx context.Context, traffic *entity.Traffic) error
}

Jump to

Keyboard shortcuts

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