Documentation
¶
Overview ¶
Package tinylib provides small functions for aws api gateway with lambda
Package tinylib provides small functions for aws api gateway with lambda ¶
Package tinylib provides small functions for aws api gateway with lambda
Index ¶
- Variables
- func CreateLocalRootUser(userid string, password string) error
- func DecryptByAES(cipherText []byte) ([]byte, error)
- func DecryptByAESwithBase64(cipherText string) (string, error)
- func EncryptByAES(plainText string) ([]byte, error)
- func EncryptByAESwithBase64(plainText string) (string, error)
- func GetIndexWithAdd(indexname string) (int64, error)
- func GetIndexWithAddWithTTL(indexname string, timeoutSecond int64) (int64, error)
- func SendEmail(from string, to []string, title string, body string) error
- func SendSQSMessage(message map[string]string, queue_name string, delaySeconds int64) error
- type Config
- func (self *Config) DynamoTableDelete(prime string) *dynamo.Delete
- func (self *Config) DynamoTableGet(prime string) *dynamo.Query
- func (self *Config) DynamoTablePut(item interface{}) *dynamo.Put
- func (self *Config) DynamoTableUpdate(prime string) *dynamo.Update
- func (self *Config) DynamoTableWriteTx() *dynamo.WriteTx
- func (self *Config) GenerateDynamoDBPrime(prime string) string
- func (self *Config) GetAESkey() string
- func (self *Config) GetAWSregion() string
- func (self *Config) GetDynamoDBtable() dynamo.Table
- func (self *Config) GetDynamoDBtableName() string
- func (self *Config) GetPasswordSalt() string
- func (self *Config) GetS3() *s3.S3
- func (self *Config) GetSQS() *sqs.SQS
- func (self *Config) GetSQSBaseURL() string
- func (self *Config) GetSessionSalt() string
- type ConfigInterface
- type Index
- type UserInterface
- func CreateLocalUser(userid string, password string, nickname string) (UserInterface, error)
- func GetAllUser(pageKey string) ([]UserInterface, string, error)
- func GetAnonymousUser() UserInterface
- func GetOrNewUser(email string, provider string) (UserInterface, error)
- func GetUser(sort string) (UserInterface, error)
- func LoginLocalUser(userid string, password string) (UserInterface, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorUserExists = errors.New("Specified User ID already exists.") ErrorUserNotExists = errors.New("Specified User ID does not existed.") )
Functions ¶
func CreateLocalRootUser ¶
func DecryptByAES ¶
func DecryptByAESwithBase64 ¶
func EncryptByAES ¶
func EncryptByAESwithBase64 ¶
func GetIndexWithAdd ¶
func GetIndexWithAddWithTTL ¶
Types ¶
type Config ¶
type Config struct { AWS_REGION string SESSION_SALT string SESSION_SALT_DB string PASSWORD_SALT string PASSWORD_SALT_DB string DynamoDB_TABLE_NAME string DynamoDB_TABLE_PREFIX string DynamoDB_TABLE_SUFFIX string DynamoDb *dynamo.DB DynamoTable dynamo.Table Sqs *sqs.SQS SqsBaseURL string }
func (*Config) DynamoTableDelete ¶
func (*Config) DynamoTablePut ¶
func (*Config) DynamoTableUpdate ¶
func (*Config) DynamoTableWriteTx ¶
func (*Config) GenerateDynamoDBPrime ¶
func (*Config) GetAWSregion ¶
func (*Config) GetDynamoDBtable ¶
func (*Config) GetDynamoDBtableName ¶
func (*Config) GetPasswordSalt ¶
func (*Config) GetSQSBaseURL ¶
func (*Config) GetSessionSalt ¶
type ConfigInterface ¶
type ConfigInterface interface { GetAWSregion() string GetDynamoDBtableName() string //GetDynamoDBprefix() string GenerateDynamoDBPrime(prime string) string DynamoTableGet(prime string) *dynamo.Query DynamoTablePut(item interface{}) *dynamo.Put DynamoTableWriteTx() *dynamo.WriteTx DynamoTableDelete(prime string) *dynamo.Delete DynamoTableUpdate(prime string) *dynamo.Update GetSessionSalt() string GetPasswordSalt() string GetAESkey() string GetDynamoDBtable() dynamo.Table GetS3() *s3.S3 GetSQS() *sqs.SQS GetSQSBaseURL() string }
func GetConfig ¶
func GetConfig() (ConfigInterface, error)
type UserInterface ¶
type UserInterface interface { Save() error IsAnonymous() bool IsAdmin() bool GetSort() string SetNickname(string) error PasswordCheck(string) error GetJsonVal(string) (string, error) SetJsonVal(key string, val string) error SetBasicAttr(disabled bool, admin bool, staff bool) error }
func CreateLocalUser ¶
func CreateLocalUser(userid string, password string, nickname string) (UserInterface, error)
func GetAllUser ¶
func GetAllUser(pageKey string) ([]UserInterface, string, error)
func GetAnonymousUser ¶
func GetAnonymousUser() UserInterface
func GetOrNewUser ¶
func GetOrNewUser(email string, provider string) (UserInterface, error)
func GetUser ¶
func GetUser(sort string) (UserInterface, error)
func LoginLocalUser ¶
func LoginLocalUser(userid string, password string) (UserInterface, error)
Click to show internal directories.
Click to hide internal directories.