Documentation
¶
Index ¶
- Constants
- func BoolPtr(value bool) *bool
- func BoolPtrIfSet(value bool) *bool
- func IsBoolSet(value *bool) bool
- func MarshalLogMsgAttrDump(value interface{}, destination map[string]interface{})
- func Set(s Service)
- type AWSAccessKey
- type AWSConfig
- type Build
- type Config
- type ConfigWrapper
- type ConnectionID
- type Date
- func (date Date) After(rhs Date) bool
- func (date Date) Day() uint
- func (date Date) MarshalDynamoDBAttributeValue(result *dynamodb.AttributeValue) error
- func (date Date) MarshalText() ([]byte, error)
- func (date Date) Month() time.Month
- func (date Date) Number() uint
- func (date Date) String() string
- func (date *Date) UnmarshalDynamoDBAttributeValue(source *dynamodb.AttributeValue) error
- func (date *Date) UnmarshalText(source []byte) error
- func (date Date) Year() uint
- type DateOrTime
- func (time DateOrTime) IsEqual(rhs DateOrTime) bool
- func (time DateOrTime) MarshalDynamoDBAttributeValue(result *dynamodb.AttributeValue) error
- func (time DateOrTime) MarshalText() ([]byte, error)
- func (time DateOrTime) String() string
- func (time *DateOrTime) UnmarshalDynamoDBAttributeValue(source *dynamodb.AttributeValue) error
- func (time *DateOrTime) UnmarshalText(source []byte) error
- type DeviceID
- type EntityID
- func (id EntityID) MarshalBinary() ([]byte, error)
- func (id EntityID) MarshalDynamoDBAttributeValue(result *dynamodb.AttributeValue) error
- func (id EntityID) MarshalText() ([]byte, error)
- func (id EntityID) String() string
- func (id *EntityID) UnmarshalBinary(data []byte) error
- func (id *EntityID) UnmarshalDynamoDBAttributeValue(source *dynamodb.AttributeValue) error
- func (id *EntityID) UnmarshalText(data []byte) error
- type FirebaseCloudMessagingToken
- type FirebaseConfig
- type Log
- type LogMsg
- func (m *LogMsg) Add(source LogMsgAttr) *LogMsg
- func (m *LogMsg) AddAttrs(source []LogMsgAttr) *LogMsg
- func (m *LogMsg) AddCurrentStack() *LogMsg
- func (m *LogMsg) AddDump(source interface{}) *LogMsg
- func (m *LogMsg) AddErr(source error) *LogMsg
- func (m *LogMsg) AddFailPrefix(prefix LogPrefix) *LogMsg
- func (m *LogMsg) AddInfoPrefix(prefix LogPrefix) *LogMsg
- func (m *LogMsg) AddPanic(source interface{}) *LogMsg
- func (m *LogMsg) AddParent(source *LogMsg)
- func (m *LogMsg) AddRequest(source interface{}) *LogMsg
- func (m *LogMsg) AddRequestID(source string) *LogMsg
- func (m *LogMsg) AddResponse(source interface{}) *LogMsg
- func (m *LogMsg) AddVal(name string, value interface{}) *LogMsg
- func (m LogMsg) ConvertAttributesToJSON() []byte
- func (m LogMsg) ConvertToJSON() []byte
- func (m LogMsg) Error() string
- func (m LogMsg) GetErrs() []logMsgAttrErr
- func (m LogMsg) GetLevel() logLevel
- func (m LogMsg) GetMessage() string
- func (m LogMsg) MarshalAttributesMap() map[string]interface{}
- func (m LogMsg) MarshalMap() map[string]interface{}
- func (m *LogMsg) SetLevel(source logLevel)
- type LogMsgAttr
- type LogMsgAttrDumpGroup
- type LogMsgAttrVal
- type LogPrefix
- type LogSession
- type LogSource
- type LogStream
- type NoCopy
- type NoCopyImpl
- type RSAPrivateKey
- type Service
- type ServiceConfig
- type ServiceParams
- type Time
- func (time Time) Add(duration time.Duration) Time
- func (time Time) AddDate(years int, months int, days int) Time
- func (time Time) After(rhs Time) bool
- func (time Time) Before(rhs Time) bool
- func (time Time) Equal(rhs Time) bool
- func (time Time) Get() stdtime.Time
- func (time Time) MarshalDynamoDBAttributeValue(result *dynamodb.AttributeValue) error
- func (time Time) MarshalText() ([]byte, error)
- func (time Time) String() string
- func (time Time) UTC() Time
- func (time Time) Unix() int64
- func (time *Time) UnmarshalDynamoDBAttributeValue(source *dynamodb.AttributeValue) error
- func (time *Time) UnmarshalText(source []byte) error
- type UserID
Constants ¶
const EntityIDSize = 16
EntityIDSize is the size of EntityID in bytes.
const UserIDSize = EntityIDSize
UserIDSize is the size of UserID in bytes.
Variables ¶
This section is empty.
Functions ¶
func BoolPtrIfSet ¶
BoolPtrIfSet converts bool value into pointer on bool.
func MarshalLogMsgAttrDump ¶
func MarshalLogMsgAttrDump(
value interface{},
destination map[string]interface{},
)
Types ¶
type AWSAccessKey ¶
type AWSAccessKey struct {
IsUsed bool
// contains filtered or unexported fields
}
func NewAWSAccessKey ¶
func NewAWSAccessKey(id, secret string) AWSAccessKey
func (*AWSAccessKey) UnmarshalJSON ¶
func (key *AWSAccessKey) UnmarshalJSON(source []byte) error
type AWSConfig ¶
type AWSConfig struct {
AccountID string `json:"accountId"`
Region string `json:"region"`
AccessKey AWSAccessKey `json:"accessKey"`
Gateway struct {
App struct {
ID string `json:"id"`
// Endpoint is the app API gateway full path, set by builder.
Endpoint string `json:"endpoint"`
} `json:"app"`
Auth struct {
ID string `json:"id"`
} `json:"auth"`
} `json:"gateway"`
// LambdaTimeout is the max lambda run time before a forced kill.
LambdaTimeout time.Duration
}
type Build ¶
type Build struct {
Version string `json:"version"` // verbose product version
Commit string `json:"commit"` // full repository commid ID
ID string `json:"id"` // verbose shot build ID to compare
Builder string `json:"builder"` // build ID on builder
Maintainer string `json:"maintainer"` // person who started build
}
func (Build) GetEnvironment ¶
type Config ¶
type Config struct {
SS struct {
Service ServiceConfig `json:"service"`
Build Build `json:"build"`
Log logConfig `json:"log"`
} `json:"ss"`
}
//////////////////////////////////////////////////////////////////////////////
type ConfigWrapper ¶
type ConfigWrapper interface {
GetBasePtr() interface{}
GetSSPtr() *Config
}
type ConnectionID ¶
type ConnectionID string
ConnectionID is a connection ID.
func (ConnectionID) MarshalLogMsg ¶
func (id ConnectionID) MarshalLogMsg(destination map[string]interface{})
type Date ¶
type Date struct {
// contains filtered or unexported fields
}
func NewDateFromTime ¶
func (Date) MarshalDynamoDBAttributeValue ¶
func (date Date) MarshalDynamoDBAttributeValue( result *dynamodb.AttributeValue, ) error
func (Date) MarshalText ¶
func (*Date) UnmarshalDynamoDBAttributeValue ¶
func (date *Date) UnmarshalDynamoDBAttributeValue( source *dynamodb.AttributeValue, ) error
func (*Date) UnmarshalText ¶
type DateOrTime ¶
DateOrTime is an object which could have date and time, or date only.
func NewDateOrTime ¶
func NewDateOrTime(value Time, isDateOnly bool) DateOrTime
NewDateOrTime creates new DateOrTime.
func (DateOrTime) IsEqual ¶
func (time DateOrTime) IsEqual(rhs DateOrTime) bool
IsEqual reports whether values represent the same time instant.
func (DateOrTime) MarshalDynamoDBAttributeValue ¶
func (time DateOrTime) MarshalDynamoDBAttributeValue( result *dynamodb.AttributeValue, ) error
MarshalDynamoDBAttributeValue implements serialization for Dynamodb.
func (DateOrTime) MarshalText ¶
func (time DateOrTime) MarshalText() ([]byte, error)
func (DateOrTime) String ¶
func (time DateOrTime) String() string
func (*DateOrTime) UnmarshalDynamoDBAttributeValue ¶
func (time *DateOrTime) UnmarshalDynamoDBAttributeValue( source *dynamodb.AttributeValue, ) error
UnmarshalDynamoDBAttributeValue implements reading from Dynamodb.
func (*DateOrTime) UnmarshalText ¶
func (time *DateOrTime) UnmarshalText(source []byte) error
type EntityID ¶
EntityID is an abstract project entity ID.
func ParseEntityID ¶
ParseEntityID parses ID in string.
func (EntityID) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler.
func (EntityID) MarshalDynamoDBAttributeValue ¶
func (id EntityID) MarshalDynamoDBAttributeValue( result *dynamodb.AttributeValue, ) error
MarshalDynamoDBAttributeValue implements serialization for Dynamodb.
func (EntityID) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*EntityID) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler.
func (*EntityID) UnmarshalDynamoDBAttributeValue ¶
func (id *EntityID) UnmarshalDynamoDBAttributeValue( source *dynamodb.AttributeValue, ) error
UnmarshalDynamoDBAttributeValue implements reading from Dynamodb.
func (*EntityID) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type FirebaseCloudMessagingToken ¶
type FirebaseCloudMessagingToken string
func NewFirebaseCloudMessagingToken ¶
func NewFirebaseCloudMessagingToken(source string) FirebaseCloudMessagingToken
func (FirebaseCloudMessagingToken) MarshalLogMsg ¶
func (token FirebaseCloudMessagingToken) MarshalLogMsg( destination map[string]interface{}, )
func (FirebaseCloudMessagingToken) String ¶
func (token FirebaseCloudMessagingToken) String() string
type FirebaseConfig ¶
type FirebaseConfig struct {
IsUsed bool
// contains filtered or unexported fields
}
func (FirebaseConfig) GetJSON ¶
func (config FirebaseConfig) GetJSON() []byte
func (*FirebaseConfig) UnmarshalJSON ¶
func (config *FirebaseConfig) UnmarshalJSON(source []byte) error
type Log ¶
type Log interface {
LogStream
Started()
// NewLogSession creates the log session which allows setting records
// prefix for each session message.
NewSession(newPrefix func() LogPrefix) LogSession
// CheckExit makes final check for panic, writes all error data.
// It has to be the one and the lowest level check in the call.
// Each goroutine should has at the beggining sonthing like:
// defer func() { service.log.CheckExit(recover()) }()
CheckExit(panicValue interface{})
}
type LogMsg ¶
type LogMsg struct {
// contains filtered or unexported fields
}
func (*LogMsg) Add ¶
func (m *LogMsg) Add(source LogMsgAttr) *LogMsg
func (*LogMsg) AddAttrs ¶
func (m *LogMsg) AddAttrs(source []LogMsgAttr) *LogMsg
func (*LogMsg) AddCurrentStack ¶
func (*LogMsg) AddFailPrefix ¶
func (*LogMsg) AddInfoPrefix ¶
func (*LogMsg) AddRequest ¶
func (*LogMsg) AddRequestID ¶
func (*LogMsg) AddResponse ¶
func (LogMsg) ConvertAttributesToJSON ¶
func (LogMsg) ConvertToJSON ¶
func (LogMsg) GetMessage ¶
func (LogMsg) MarshalAttributesMap ¶
func (LogMsg) MarshalMap ¶
type LogMsgAttr ¶
type LogMsgAttr interface {
MarshalLogMsg(destination map[string]interface{})
}
func NewLogMsgAttrRequestDumps ¶
func NewLogMsgAttrRequestDumps(value interface{}) []LogMsgAttr
type LogMsgAttrDumpGroup ¶
type LogMsgAttrDumpGroup struct {
// contains filtered or unexported fields
}
func NewLogMsgAttrDumpGroup ¶
func NewLogMsgAttrDumpGroup( groupNode string, value interface{}, ) LogMsgAttrDumpGroup
func (LogMsgAttrDumpGroup) MarshalLogMsg ¶
func (a LogMsgAttrDumpGroup) MarshalLogMsg(destination map[string]interface{})
type LogMsgAttrVal ¶
type LogMsgAttrVal struct {
// contains filtered or unexported fields
}
func NewLogMsgAttrVal ¶
func NewLogMsgAttrVal(node string, value interface{}) LogMsgAttrVal
func (LogMsgAttrVal) MarshalLogMsg ¶
func (a LogMsgAttrVal) MarshalLogMsg(destination map[string]interface{})
type LogPrefix ¶
type LogPrefix struct {
// contains filtered or unexported fields
}
func NewLogPrefix ¶
func NewLogPrefix(newFailAttrs func() []LogMsgAttr) LogPrefix
func (LogPrefix) Add ¶
func (lp LogPrefix) Add(a LogMsgAttr) LogPrefix
func (LogPrefix) AddRequestID ¶
type LogSession ¶
type LogSession interface {
LogStream
// NewLogSession creates the log session which allows setting records
// prefix for each session message.
NewSession(newPrefix func() LogPrefix) LogSession
}
type LogStream ¶
type LogStream interface {
NoCopy
Debug(*LogMsg)
Info(*LogMsg)
Warn(*LogMsg)
Error(*LogMsg)
Panic(*LogMsg)
CheckPanic(panicValue interface{}, errorMessage string)
// contains filtered or unexported methods
}
Log describes product log interface.
type NoCopy ¶
type NoCopy interface {
Lock()
Unlock()
}
Lock is a no-op used by -copylocks checker from `go vet`.
type NoCopyImpl ¶
type NoCopyImpl struct{}
Lock is a no-op used by -copylocks checker from `go vet`.
func (*NoCopyImpl) Lock ¶
func (*NoCopyImpl) Lock()
func (*NoCopyImpl) Unlock ¶
func (*NoCopyImpl) Unlock()
type RSAPrivateKey ¶
type RSAPrivateKey struct {
IsUsed bool
// contains filtered or unexported fields
}
func (RSAPrivateKey) Get ¶
func (key RSAPrivateKey) Get() *rsa.PrivateKey
func (*RSAPrivateKey) UnmarshalJSON ¶
func (key *RSAPrivateKey) UnmarshalJSON(jsonSource []byte) error
type Service ¶
type Service interface {
NoCopy
Now() Time
Log() Log
Product() string
Name() string
Config() ServiceConfig
Build() Build
StartLambda(getFailInfo func() []LogMsgAttr)
CompleteLambda(panicValue interface{})
SubscribeForLambdaTimeout() <-chan struct{}
NewBuildEntityName(name string) string
NewAWSConfig() aws.Config
NewAWSSessionV1() *session.Session
Firebase() *firebase.App
}
Service is the root interface of the service.
var S Service
S is the standalone service instance.
func NewService ¶
func NewService( product string, projectPackage string, params ServiceParams, configWrapper ConfigWrapper, ) Service
NewService creates new service instance.
type ServiceConfig ¶
type ServiceConfig struct {
Endpoint string `json:"endpoint"`
HeaderPrefix string `json:"headerPrefix"`
AWS AWSConfig `json:"aws"`
Firebase FirebaseConfig `json:"firebase"`
PrivateKey struct {
RSA RSAPrivateKey `json:"rsa"`
} `json:"privateKey"`
App struct {
MinVersion [4]uint `json:"minVer"`
Domain string `json:"domain"`
Android struct {
Package string `json:"package"`
} `json:"android"`
IOS struct {
Bundle string `json:"bundle"`
} `json:"ios"`
} `json:"app"`
}
func (ServiceConfig) IsExtraLogEnabled ¶
func (ServiceConfig) IsExtraLogEnabled() bool
type ServiceParams ¶
ServiceParams is a set of service parameters.
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
func NewTimeFromDate ¶
func (Time) MarshalDynamoDBAttributeValue ¶
func (time Time) MarshalDynamoDBAttributeValue( result *dynamodb.AttributeValue, ) error
func (Time) MarshalText ¶
func (*Time) UnmarshalDynamoDBAttributeValue ¶
func (time *Time) UnmarshalDynamoDBAttributeValue( source *dynamodb.AttributeValue, ) error
UnmarshalDynamoDBAttributeValue implements reading from Dynamodb.
func (*Time) UnmarshalText ¶
type UserID ¶
type UserID struct{ EntityID }
ss.UserID is a user ID.
func ParseUserID ¶
LoadUserID loads UserID from entity ID.
func (UserID) MarshalLogMsg ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
gateway
|
|
|
Package mock_ss is a generated GoMock package.
|
Package mock_ss is a generated GoMock package. |
|
ddb/install
Package mock_ddbinstall is a generated GoMock package.
|
Package mock_ddbinstall is a generated GoMock package. |