app

package
v0.0.0-...-977fba5 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package app Application core.

Index

Constants

View Source
const (
	CodeInternalError int
	CodeInvalidPayloadFormat
	CodeInvalidPayloadFields
	CodeServiceReadError
	CodeServiceReadNotFound
	CodeServiceWriteError
	CodeAdapterError
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Host    string `yaml:"host" json:"host"`
	Name    string `yaml:"name" json:"name"`
	Port    int    `yaml:"port" json:"port"`
	Version string `yaml:"version" json:"version"`

	// Consul
	// enabled status.
	//
	// True is enabled otherwise disabled.
	Consul bool `yaml:"consul" json:"consul"`

	// Consul address.
	//
	// Register service to this address. Read and deregister
	// from this address.
	//
	// Example: 192.168.1.100:8500
	ConsulAddr string `yaml:"consul-addr" json:"consul-addr"`

	// Consul protocol.
	//
	// Accept http, https. Default is http.
	//
	// Example: http
	// Example: https
	ConsulScheme string `yaml:"consul-scheme" json:"consul-scheme"`

	// This application service address.
	//
	// Generate it as service address for consul service
	// registry.
	//
	// Example: 172.16.0.100
	// Example: myapp.example.com
	ConsulServiceAddr string `yaml:"consul-service-addr" json:"consul-service-addr"`

	// This application service port.
	//
	// Generate it as service port for consul service
	// registry.
	//
	// Example: 8080
	ConsulServicePort string `yaml:"consul-service-port" json:"consul-service-port"`

	// Executed address.
	// Example: 172.16.0.100:8080
	Addr string `yaml:"-" json:"-"`

	// Running pid.
	// Example: 3721
	Pid int `yaml:"-" json:"-"`

	// Executed software name.
	// Example: GMD/1.2.3
	Software string `yaml:"-" json:"-"`

	// Config initialized time.
	StartTime time.Time `yaml:"-" json:"-"`
}
var (
	Config *Configuration
)

func (*Configuration) LoadJson

func (o *Configuration) LoadJson(name string) error

LoadJson read json file and assign into fields.

func (*Configuration) LoadYaml

func (o *Configuration) LoadYaml(name string) error

LoadYaml read yaml file and assign into fields.

func (*Configuration) Update

func (o *Configuration) Update()

Update execution fields based on assigned.

Directories

Path Synopsis
Package controllers MVC Controller with route prefix /.
Package controllers MVC Controller with route prefix /.
task
Package task MVC Controller with route prefix /task.
Package task MVC Controller with route prefix /task.
topic
Package topic MVC Controller with route prefix /topic.
Package topic MVC Controller with route prefix /topic.
Package logics Application logical.
Package logics Application logical.
md
Package md Core library for mq dispatcher.
Package md Core library for mq dispatcher.
adapters
Package adapters Message queue adapters.
Package adapters Message queue adapters.
adapters/aliyunmns
Package aliyunmns Message queue adapter on AliyunMNS.
Package aliyunmns Message queue adapter on AliyunMNS.
adapters/rabbitmq
Package rabbitmq Message queue adapter on RabbitMQ.
Package rabbitmq Message queue adapter on RabbitMQ.
adapters/rocketmq
Package rocketmq Message queue adapter on RocketMQ.
Package rocketmq Message queue adapter on RocketMQ.
base
Package base Secondary level of core library.
Package base Secondary level of core library.
conf
Package conf Top level of core library configurations.
Package conf Top level of core library configurations.
dispatchers
Package dispatchers Top level of core library for dispatcher message interface.
Package dispatchers Top level of core library for dispatcher message interface.
Package middlewares Application middlewares for MVC request.
Package middlewares Application middlewares for MVC request.
Package models Database model definition.
Package models Database model definition.
Package services Database manage center.
Package services Database manage center.

Jump to

Keyboard shortcuts

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