get rid of all config stuff in core
This commit is contained in:
parent
6d34ac7359
commit
ecb056b61e
4 changed files with 13 additions and 23 deletions
|
@ -4,23 +4,12 @@
|
||||||
(:use :common-lisp)
|
(:use :common-lisp)
|
||||||
(:local-nicknames (:config :scopes/config)
|
(:local-nicknames (:config :scopes/config)
|
||||||
(:message :scopes/core/message))
|
(:message :scopes/core/message))
|
||||||
(:export #:service-config #:add-config #:add-action
|
(:export #:default-setup #:setup-services
|
||||||
#:default-setup #:setup-services
|
#:context #:add-action #:*root* #:find-service #:config #:name #:send
|
||||||
#:context #:*root* #:find-service #:config #:name #:send
|
|
||||||
#:printer))
|
#:printer))
|
||||||
|
|
||||||
(in-package :scopes/core)
|
(in-package :scopes/core)
|
||||||
|
|
||||||
;;;; config
|
|
||||||
|
|
||||||
(defclass service-config (config:base)
|
|
||||||
((setup :initform #'default-setup)))
|
|
||||||
|
|
||||||
(defun add-config (parent name &rest params
|
|
||||||
&key (setup #'default-setup) (class 'service-config)
|
|
||||||
&allow-other-keys)
|
|
||||||
(apply #'make-instance class :parent parent :name name :setup setup params))
|
|
||||||
|
|
||||||
;;;; actions
|
;;;; actions
|
||||||
|
|
||||||
(defclass action-spec ()
|
(defclass action-spec ()
|
||||||
|
|
|
@ -4,11 +4,10 @@
|
||||||
|
|
||||||
(setf *config* (config:root :env-keys '(:address :port)))
|
(setf *config* (config:root :env-keys '(:address :port)))
|
||||||
|
|
||||||
(let ((cfg (core:add-config *config* :server
|
(let ((cfg (config:add *config* :server
|
||||||
:class 'server:config
|
:class 'server:config
|
||||||
:setup #'server:setup
|
:port "8899"))))
|
||||||
:port "8899"))))
|
|
||||||
|
|
||||||
(let ((cfg (core:add-config *config* :client
|
(let ((cfg (config:add *config* :client
|
||||||
:class 'client:config
|
:class 'client:config
|
||||||
:base-url "http://localhost:8899"))))
|
:base-url "http://localhost:8899"))))
|
||||||
|
|
|
@ -9,8 +9,9 @@
|
||||||
|
|
||||||
(in-package :scopes/web/client)
|
(in-package :scopes/web/client)
|
||||||
|
|
||||||
(defclass config (core:service-config)
|
(defclass config (config:base)
|
||||||
((base-url :reader base-url
|
((config:setup :initform #'core:default-setup)
|
||||||
|
(base-url :reader base-url
|
||||||
:initarg :base-url
|
:initarg :base-url
|
||||||
:initform "http://localhost:8135")))
|
:initform "http://localhost:8135")))
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,9 @@
|
||||||
|
|
||||||
(in-package :scopes/web/server)
|
(in-package :scopes/web/server)
|
||||||
|
|
||||||
(defclass config (core:service-config)
|
(defclass config (config:base)
|
||||||
((config:env-slots :initform '(address port))
|
((config:env-slots :initform '(address port))
|
||||||
|
(config:setup :initform #'setup)
|
||||||
(address :reader address :initarg :address :initform "localhost")
|
(address :reader address :initarg :address :initform "localhost")
|
||||||
(port :reader port :initarg :port :initform "8888")))
|
(port :reader port :initarg :port :initform "8888")))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue