awsss

package module
v0.0.0-...-b91ac4e Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBuildEntityName

func NewBuildEntityName(product, name string) string

NewBuildEntityName create a string with entity name which depends on build.

func Now

func Now() time.Time

Now return current platform time in correct time zone.

Types

type AWSAccessKey

type AWSAccessKey struct {
	IsUsed bool
	// contains filtered or unexported fields
}

func (*AWSAccessKey) UnmarshalJSON

func (key *AWSAccessKey) UnmarshalJSON(source []byte) error

type Build

type Build struct {
	Version    string `json:"version"`
	Commit     string `json:"commit"`
	ID         string `json:"id"`
	Builder    string `json:"builder"`
	Maintainer string `json:"maintainer"`
}

func (Build) IsProd

func (build Build) IsProd() bool

IsProd returns true if build is production.

type Config

type Config struct {
	AWSSS struct {
		Service ServiceConfig `json:"service"`
		Build   Build         `json:"build"`
		Log     logConfig     `json:"log"`
	} `json:"awsss"`
}

type ConfigWrapper

type ConfigWrapper interface {
	GetBasePtr() interface{}
	GetAWSSSPtr() *Config
}

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 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 {
	Log() ServiceLog
	Name() string
	Build() Build
}

Service is the root interface of the service.

var S Service

S is the standalone service instance.

func NewServiceStandalone

func NewServiceStandalone(
	projectPackage string,
	name string,
	isAWS bool,
	isFirebase bool,
	isAuth bool,
	configWrapper ConfigWrapper,
) Service

NewServiceStandalone creates new service instance and registers it as standalone.

type ServiceConfig

type ServiceConfig struct {
	AWS struct {
		AccountID string       `json:"accountId"`
		Region    string       `json:"region"`
		AccessKey AWSAccessKey `json:"accessKey"`
		Gateway   struct {
			App struct {
				ID       string `json:"id"`
				Endpoint string `json:"endpoint"`
			} `json:"app"`
		} `json:"gateway"`
	} `json:"aws"`
	Firebase   FirebaseConfig `json:"firebase"`
	PrivateKey struct {
		RSA RSAPrivateKey `json:"rsa"`
	} `json:"privateKey"`
}

type ServiceLog

type ServiceLog interface {
	// NewLogSession creates the log session which allows setting records
	// prefix for each session message.
	NewSession(prefix string) ServiceLog

	CheckExit()

	Started()

	Debug(format string, args ...interface{})

	Info(format string, args ...interface{})

	Warn(format string, args ...interface{})

	Error(format string, args ...interface{})
	Err(err error)

	Panic(format string, args ...interface{})
}

ServiceLog describes product log interface.

Directories

Path Synopsis
lib module

Jump to

Keyboard shortcuts

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