data

package
v0.0.0-...-04b2c92 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package data is the data tools. It is used to initialize the database data or test data.

Index

Constants

View Source
const (
	DefaultDsn    string = "root:pass@tcp(localhost:3306)/portal?parseTime=true&loc=Local"
	DefaultDriver string = "mysql"
)

Variables

This section is empty.

Functions

func InitBase

func InitBase(name, dsn string)

InitBase init base data: app, file source, oauth client, user, org and their relationship.

in sqlite,

func InitResourcePolicy

func InitResourcePolicy(client *ent.Tx)

InitResourcePolicy init resource policy.

func ParseDNS

func ParseDNS(dsn *string)

ParseDNS parse dsn.Parameter dsn is the cmd argument, if dsn is empty, try to get dsn from environment variable, if dsn is empty will fall back to DefaultDsn.

Types

This section is empty.

Jump to

Keyboard shortcuts

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