env

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package env is a utility package for env.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Env

func Env() *utilEnv

Env .

Types

type AlibabaEnv

type AlibabaEnv struct {
	// contains filtered or unexported fields
}

AlibabaEnv .

func NewAlibabaEnv

func NewAlibabaEnv(ctx context.Context) (*AlibabaEnv, error)

NewAlibabaEnv .

func (*AlibabaEnv) AccessKeyID

func (e *AlibabaEnv) AccessKeyID(_ context.Context) string

AccessKeyID .

func (*AlibabaEnv) AccessKeySecret

func (e *AlibabaEnv) AccessKeySecret(_ context.Context) string

AccessKeySecret .

func (*AlibabaEnv) BucketName

func (e *AlibabaEnv) BucketName(_ context.Context) string

BucketName .

func (*AlibabaEnv) Config

func (e *AlibabaEnv) Config(_ context.Context) map[string]string

Config .

func (*AlibabaEnv) Endpoint

func (e *AlibabaEnv) Endpoint(_ context.Context) string

Endpoint .

func (*AlibabaEnv) Region

func (e *AlibabaEnv) Region(_ context.Context) string

Region .

func (*AlibabaEnv) String

func (e *AlibabaEnv) String(_ context.Context) string

String .

type AppEnv

type AppEnv struct {
	// contains filtered or unexported fields
}

AppEnv .

func New

func New(ctx context.Context) (*AppEnv, error)

New create app environment

func (*AppEnv) Config

func (e *AppEnv) Config(_ context.Context) map[string]string

Config .获取配置信息

func (*AppEnv) Env

func (e *AppEnv) Env(_ context.Context) string

Env .

func (*AppEnv) Environment

func (e *AppEnv) Environment(_ context.Context) string

Environment .

func (*AppEnv) FrontSite

func (e *AppEnv) FrontSite(_ context.Context) string

FrontSite .

func (*AppEnv) HostIP

func (e *AppEnv) HostIP(_ context.Context) string

HostIP . 获取本机IP

func (*AppEnv) JaegerEndpoint

func (e *AppEnv) JaegerEndpoint(_ context.Context) string

JaegerEndpoint .

func (*AppEnv) RoleModel

func (e *AppEnv) RoleModel(_ context.Context) string

RoleModel .

func (*AppEnv) Site

func (e *AppEnv) Site(_ context.Context) string

Site .网站名称

func (*AppEnv) String

func (e *AppEnv) String(_ context.Context) string

String

func (*AppEnv) UploadPath

func (e *AppEnv) UploadPath(_ context.Context) string

UploadPath . 上传路径

func (*AppEnv) Version

func (e *AppEnv) Version(_ context.Context) string

Version .

func (*AppEnv) VisitPath

func (e *AppEnv) VisitPath(_ context.Context) string

VisitPath file server访问路径

type LarkEnv

type LarkEnv struct {
	// contains filtered or unexported fields
}

LarkEnv lark environment.

func NewLark

func NewLark(ctx context.Context) (*LarkEnv, error)

NewLark .create a new lark environment

func (*LarkEnv) APPID

func (e *LarkEnv) APPID(_ context.Context) string

APPID .

func (*LarkEnv) APPSecret

func (e *LarkEnv) APPSecret(_ context.Context) string

APPSecret .

func (*LarkEnv) Config

func (e *LarkEnv) Config(_ context.Context) map[string]string

Config .

func (*LarkEnv) CustomBotSecret

func (e *LarkEnv) CustomBotSecret(_ context.Context) string

CustomBotSecret .

func (*LarkEnv) CustomBotWebHookURL

func (e *LarkEnv) CustomBotWebHookURL(_ context.Context) string

CustomBotWebHookURL .

func (*LarkEnv) EncryptKey

func (e *LarkEnv) EncryptKey(_ context.Context) string

EncryptKey .

func (*LarkEnv) String

func (e *LarkEnv) String(_ context.Context) string

String returns the string representation of the environment.

func (*LarkEnv) VerificationToken

func (e *LarkEnv) VerificationToken(_ context.Context) string

VerificationToken .

type OSSEnv

type OSSEnv struct {
	// contains filtered or unexported fields
}

OSSEnv is the environment variable for oss

func NewOssEnv

func NewOssEnv(ctx context.Context, key string) (*OSSEnv, error)

NewOssEnv create a new oss env

func (*OSSEnv) AccessKeyID

func (e *OSSEnv) AccessKeyID(_ context.Context) string

AccessKeyID get access key id

func (*OSSEnv) AccessKeySecret

func (e *OSSEnv) AccessKeySecret(_ context.Context) string

AccessKeySecret get access key secret

func (*OSSEnv) Bucket

func (e *OSSEnv) Bucket(_ context.Context) string

Bucket get bucket

func (*OSSEnv) Config

func (e *OSSEnv) Config(_ context.Context) map[string]string

Config get config

func (*OSSEnv) Domain

func (e *OSSEnv) Domain(_ context.Context) string

Domain get domain

func (*OSSEnv) Endpoint

func (e *OSSEnv) Endpoint(_ context.Context) string

Endpoint get endpoint

func (*OSSEnv) String

func (e *OSSEnv) String(_ context.Context) string

String get string

type SnowflakeEnv

type SnowflakeEnv struct {
	// contains filtered or unexported fields
}

SnowflakeEnv .

func NewSnowflakeEnv

func NewSnowflakeEnv(ctx context.Context) (*SnowflakeEnv, error)

NewSnowflakeEnv .

func (*SnowflakeEnv) Config

func (e *SnowflakeEnv) Config(_ context.Context) map[string]*gvar.Var

Config .

func (*SnowflakeEnv) Datacenter

func (e *SnowflakeEnv) Datacenter(_ context.Context) int64

Datacenter .

func (*SnowflakeEnv) String

func (e *SnowflakeEnv) String(_ context.Context) string

String .

func (*SnowflakeEnv) Worker

func (e *SnowflakeEnv) Worker(_ context.Context) int64

Worker .

type TencentEnv

type TencentEnv struct {
	// contains filtered or unexported fields
}

TencentEnv .

func NewTencentEnv

func NewTencentEnv(ctx context.Context) (*TencentEnv, error)

NewTencentEnv .

func (*TencentEnv) Config

func (e *TencentEnv) Config(_ context.Context) map[string]string

Config .

func (*TencentEnv) Endpoint

func (e *TencentEnv) Endpoint(_ context.Context) string

Endpoint .

func (*TencentEnv) Region

func (e *TencentEnv) Region(_ context.Context) string

Region .

func (*TencentEnv) SecretID

func (e *TencentEnv) SecretID(_ context.Context) string

SecretID .

func (*TencentEnv) SecretKey

func (e *TencentEnv) SecretKey(_ context.Context) string

SecretKey .

func (*TencentEnv) String

func (e *TencentEnv) String(_ context.Context) string

String .

Jump to

Keyboard shortcuts

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