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)
|
||||
(:local-nicknames (:config :scopes/config)
|
||||
(:message :scopes/core/message))
|
||||
(:export #:service-config #:add-config #:add-action
|
||||
#:default-setup #:setup-services
|
||||
#:context #:*root* #:find-service #:config #:name #:send
|
||||
(:export #:default-setup #:setup-services
|
||||
#:context #:add-action #:*root* #:find-service #:config #:name #:send
|
||||
#:printer))
|
||||
|
||||
(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
|
||||
|
||||
(defclass action-spec ()
|
||||
|
|
|
@ -4,11 +4,10 @@
|
|||
|
||||
(setf *config* (config:root :env-keys '(:address :port)))
|
||||
|
||||
(let ((cfg (core:add-config *config* :server
|
||||
:class 'server:config
|
||||
:setup #'server:setup
|
||||
:port "8899"))))
|
||||
(let ((cfg (config:add *config* :server
|
||||
:class 'server:config
|
||||
:port "8899"))))
|
||||
|
||||
(let ((cfg (core:add-config *config* :client
|
||||
:class 'client:config
|
||||
:base-url "http://localhost:8899"))))
|
||||
(let ((cfg (config:add *config* :client
|
||||
:class 'client:config
|
||||
:base-url "http://localhost:8899"))))
|
||||
|
|
|
@ -9,8 +9,9 @@
|
|||
|
||||
(in-package :scopes/web/client)
|
||||
|
||||
(defclass config (core:service-config)
|
||||
((base-url :reader base-url
|
||||
(defclass config (config:base)
|
||||
((config:setup :initform #'core:default-setup)
|
||||
(base-url :reader base-url
|
||||
:initarg :base-url
|
||||
:initform "http://localhost:8135")))
|
||||
|
||||
|
|
|
@ -9,8 +9,9 @@
|
|||
|
||||
(in-package :scopes/web/server)
|
||||
|
||||
(defclass config (core:service-config)
|
||||
(defclass config (config:base)
|
||||
((config:env-slots :initform '(address port))
|
||||
(config:setup :initform #'setup)
|
||||
(address :reader address :initarg :address :initform "localhost")
|
||||
(port :reader port :initarg :port :initform "8888")))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue