8000 GitHub - slclub/link: code link point. When you use other source code, try to encapsulate it as much as possible. In the future, you can easily replace them with others
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ link Public

code link point. When you use other source code, try to encapsulate it as much as possible. In the future, you can easily replace them with others

Notifications You must be signed in to change notification settings

slclub/link

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

link

Code link point. Decoupling is also one of its purposes.

When you use other source code, try to encapsulate it as much as possible.

In the future, you can easily replace them with others

The fewer interfaces, the better.

If it has too many interfaces, it may only be used by coupling, That is your choice.

Wrap viper.

Call directly because there are too many interfaces.

This goes against the meaning of the project itself.

But viper is so great, So powerful. We don't usually give it up.

Add more source code if it like log system and config etc in the future.

// return *viper.Viper
link.Config() 
  • Default config file position is in your project directory Here i didn't create the config file. you should create it by yourself.

example:

prject : /home/xxx/web
config : /home/xxx/web/etc/go.ini

viper

Wrap glog.

Here I encapsulate my own log system.

Maybe there will be something better and more like in the future. I can easily replace it here

link.INFO(args ...interface{})
link.DEBUG(args ...interface{})
link.WARN(args ...interface{})
link.ERROR(args ...interface{})
link.FATAL(args ...interface{})

glog

etc floder just for testing used.

About

code link point. When you use other source code, try to encapsulate it as much as possible. In the future, you can easily replace them with others

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

0