ipccache

package
v1.4.21 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	ipc.Storer
	// contains filtered or unexported fields
}

func NewCache

func NewCache(store ipc.Storer) *Cache

func (*Cache) Change

func (c *Cache) Change(deviceID string, changeFn func(*ipc.Device) error, changeFn2 func(*gbs.Device)) error

Change implements gbs.MemoryStorer.

func (*Cache) Channel

func (c *Cache) Channel() ipc.ChannelStorer

func (*Cache) Device

func (c *Cache) Device() ipc.DeviceStorer

func (*Cache) GetChannel

func (c *Cache) GetChannel(deviceID string, channelID string) (*gbs.Channel, bool)

GetChannel implements gbs.MemoryStorer.

func (*Cache) Load

func (c *Cache) Load(deviceID string) (*gbs.Device, bool)

Load implements gbs.MemoryStorer.

func (*Cache) LoadDeviceToMemory

func (c *Cache) LoadDeviceToMemory(conn sip.Connection)

LoadDeviceToMemory implements gbs.MemoryStorer.

func (*Cache) LoadOrStore

func (c *Cache) LoadOrStore(deviceID string, value *gbs.Device)

LoadOrStore implements gbs.MemoryStorer.

func (*Cache) RangeDevices

func (c *Cache) RangeDevices(fn func(key string, value *gbs.Device) bool)

RangeDevices implements gbs.MemoryStorer.

func (*Cache) Store

func (c *Cache) Store(deviceID string, value *gbs.Device)

Store implements gbs.MemoryStorer.

type Channel

type Channel Cache

func (*Channel) BatchEdit

func (c *Channel) BatchEdit(ctx context.Context, field string, value any, opts ...orm.QueryOption) error

BatchEdit implements ipc.ChannelStorer.

func (*Channel) Create added in v1.4.21

func (c *Channel) Create(ctx context.Context, ch *ipc.Channel) error

Create implements ipc.ChannelStorer.

func (*Channel) Delete added in v1.4.21

func (c *Channel) Delete(ctx context.Context, ch *ipc.Channel, opts ...orm.QueryOption) error

Delete implements ipc.ChannelStorer.

func (*Channel) EditGB28181Config added in v1.4.0

func (c *Channel) EditGB28181Config(ctx context.Context, ch *ipc.Channel) error

EditGB28181Config implements ipc.ChannelStorer.

func (*Channel) Get

func (c *Channel) Get(ctx context.Context, ch *ipc.Channel, opts ...orm.QueryOption) error

Get implements ipc.ChannelStorer.

func (*Channel) List added in v1.4.21

func (c *Channel) List(ctx context.Context, chs *[]*ipc.Channel, pager orm.Pager, opts ...orm.QueryOption) (int64, error)

List implements ipc.ChannelStorer.

func (*Channel) Session

func (c *Channel) Session(ctx context.Context, changeFns ...func(*gorm.DB) error) error

Session implements ipc.ChannelStorer.

func (*Channel) Update added in v1.4.21

func (c *Channel) Update(ctx context.Context, ch *ipc.Channel, changeFn func(*ipc.Channel) error, opts ...orm.QueryOption) error

Update implements ipc.ChannelStorer.

type Device

type Device = Cache

func (*Device) Create added in v1.4.21

func (d *Device) Create(ctx context.Context, dev *ipc.Device) error

Create implements ipc.DeviceStorer.

func (*Device) Delete added in v1.4.21

func (d *Device) Delete(ctx context.Context, dev *ipc.Device, opts ...orm.QueryOption) error

Delete implements ipc.DeviceStorer.

func (*Device) Get

func (d *Device) Get(ctx context.Context, dev *ipc.Device, opts ...orm.QueryOption) error

Get implements ipc.DeviceStorer.

func (*Device) List added in v1.4.21

func (d *Device) List(ctx context.Context, devs *[]*ipc.Device, pager orm.Pager, opts ...orm.QueryOption) (int64, error)

List implements ipc.DeviceStorer.

func (*Device) Session

func (d *Device) Session(ctx context.Context, changeFns ...func(*gorm.DB) error) error

Session implements ipc.DeviceStorer.

func (*Device) Update added in v1.4.21

func (d *Device) Update(ctx context.Context, dev *ipc.Device, changeFn func(*ipc.Device) error, opts ...orm.QueryOption) error

Update implements ipc.DeviceStorer.

Jump to

Keyboard shortcuts

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