db

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBPool *pgxpool.Pool
View Source
var Snowflake = sonyflake.NewSonyflake(sonyflake.Settings{
	StartTime: time.Date(2021, time.January, 1, 0, 0, 0, 0, time.UTC),
	MachineID: func() (uint16, error) {
		conn, err := net.Dial("udp", "8.8.8.8:80")
		if err != nil {
			return 0, err
		}
		defer conn.Close()

		addr := conn.LocalAddr().(*net.UDPAddr)

		machineID := uint16(addr.IP[2])<<8 + uint16(addr.IP[3])

		return machineID, nil
	},
})

Functions

func InitializeDB

func InitializeDB() error

Types

This section is empty.

Jump to

Keyboard shortcuts

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