infra

package
v0.0.0-...-68fba19 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EscapeMySQLString

func EscapeMySQLString(value string) string

EscapeMySQLString prevents from SQL-injection.

func InitMySQLEngine

func InitMySQLEngine(conf *mysql.Config) (*xorm.Engine, error)

InitMySQLEngine initialize xorm engine for mysql

func LoadMySQLConfigEnv

func LoadMySQLConfigEnv() *mysql.Config

LoadMySQLConfigEnv initializes MySQL config using Environment Variables.

func RunSQLFile

func RunSQLFile(mysqlConnectionString, sqlFilepath string) error

RunSQLFile runs sql file.

Types

type EngineInterface

type EngineInterface interface {
	xorm.EngineInterface
	EngineSelector
}

EngineInterface xorm.EngineInterfaceの不足を追加

type EngineSelector

type EngineSelector interface {
	Select(str string) *xorm.Session
}

EngineSelector provides Select function.

type KVSClient

type KVSClient struct {
	Conn redis.Conn
	// contains filtered or unexported fields
}

KVSClient is key-value store client.

func NewKVSClient

func NewKVSClient() *KVSClient

NewKVSClient initializes key-value store client.

func (*KVSClient) Close

func (kc *KVSClient) Close()

Close closes connection.

func (*KVSClient) GetStruct

func (kc *KVSClient) GetStruct(key string, structPtr interface{}) error

GetStruct load go struct object by key.

func (*KVSClient) SetStruct

func (kc *KVSClient) SetStruct(key string, structPtr interface{}) error

SetStruct store go struct object by key.

type KVSClientInterface

type KVSClientInterface interface {
	SetStruct(key string, structPtr interface{}) error
	GetStruct(key string, structPtr interface{}) error
}

KVSClientInterface is key-value store interface.

Jump to

Keyboard shortcuts

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