me

package module
v0.0.0-...-7b2940e Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var API_BASE_URL string
View Source
var Cmd = &cobra.Command{
	Use:   "me",
	Short: "crawl ME API",
	Run: func(cmd *cobra.Command, args []string) {
		full, _ := cmd.Flags().GetBool("full")
		var ok bool
		API_BASE_URL, ok = os.LookupEnv("API_BASE_URL")
		if !ok {
			log.Fatalln("No API_BASE_URL")
		}
		SOLSCAN_PUBLIC_API_BASE_URL, ok = os.LookupEnv("SOLSCAN_PUBLIC_API_BASE_URL")
		if !ok {
			log.Fatalln("No PUBLIC_SOLSCAN_API_BASE_URL")
		}
		PGUSER, ok := os.LookupEnv("PGUSER")
		if !ok {
			log.Fatalln("No PGUSER")
		}
		PGPASSWORD, ok := os.LookupEnv("PGPASSWORD")
		if !ok {
			log.Fatalln("No PGPASSWORD")
		}
		PGHOST, ok := os.LookupEnv("PGHOST")
		if !ok {
			log.Fatalln("No PGHOST")
		}
		PGDATABASE, ok := os.LookupEnv("PGDATABASE")
		if !ok {
			log.Fatalln("No PGDATABASE")
		}
		connStr := fmt.Sprint(
			"postgres://",
			PGUSER,
			":",
			PGPASSWORD,
			"@",
			PGHOST,
			"/",
			PGDATABASE,
			"?sslmode=require",
		)
		var err error
		db, err = sql.Open("postgres", connStr)
		if err != nil {
			log.Fatalln(err)
		}
		execute(full)
	},
}
View Source
var SOLSCAN_PUBLIC_API_BASE_URL string
View Source
var UNLIMIT_PAGE = 0

Functions

This section is empty.

Types

type Item

type Item struct {
	V interface{}
	E error
}

Jump to

Keyboard shortcuts

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