Skip to content

Commit

Permalink
Merge pull request #2 from ghettovoice/master
Browse files Browse the repository at this point in the history
Merge from ghettovoice/gosip
  • Loading branch information
cloudwebrtc authored Jun 11, 2020
2 parents 2c069db + 3296b9b commit fbaca67
Show file tree
Hide file tree
Showing 33 changed files with 1,210 additions and 418 deletions.
17 changes: 17 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
66 changes: 54 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Created by .ignore support plugin (hsz.mobi)

### Linux template
*~

Expand All @@ -13,6 +14,7 @@

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### Windows template
# Windows thumbnail cache files
Thumbs.db
Expand All @@ -36,6 +38,7 @@ $RECYCLE.BIN/

# Windows shortcuts
*.lnk

### Go template
# Binaries for programs and plugins
*.exe
Expand All @@ -51,6 +54,7 @@ $RECYCLE.BIN/

# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
.glide/

### Vim template
# Swap
[._]*.s[a-v][a-z]
Expand All @@ -65,39 +69,53 @@ Session.vim
.netrwhist
# Auto-generated tag files
tags
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm

### JetBrains
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files:
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle:
# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-debug/
cmake-build-*/

# Mongo Explorer plugin:
# Mongo Explorer plugin
.idea/**/mongoSettings.xml

## File-based project format:
# File-based project format
*.iws

## Plugin-specific files:

# IntelliJ
out/

Expand All @@ -116,6 +134,30 @@ crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### JetBrains Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
.idea/**/sonarlint/

# SonarQube Plugin
.idea/**/sonarIssues.xml

# Markdown Navigator plugin
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator/

### App rules
out
*.coverprofile
8 changes: 0 additions & 8 deletions .idea/runConfigurations/test_all.xml

This file was deleted.

1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (
github.com/onsi/gomega v1.7.0
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
github.com/sirupsen/logrus v1.4.2
github.com/tevino/abool v0.0.0-20170917061928-9b9efcf221b5
github.com/x-cray/logrus-prefixed-formatter v0.5.2
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 // indirect
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/tevino/abool v0.0.0-20170917061928-9b9efcf221b5 h1:hNna6Fi0eP1f2sMBe/rJicDmaHmoXGe1Ta84FPYHLuE=
github.com/tevino/abool v0.0.0-20170917061928-9b9efcf221b5/go.mod h1:f1SCnEOt6sc3fOJfPQDRDzHOtSXuTtnz0ImG9kPRDV0=
github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJzfthRT6usrui8uGmg=
github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
Expand Down
1 change: 1 addition & 0 deletions gosip.iml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.github" />
<excludeFolder url="file://$MODULE_DIR$/.idea" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
Expand Down
14 changes: 14 additions & 0 deletions log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,17 @@ func (fields Fields) WithFields(newFields Fields) Fields {

return allFields
}

func AddFieldsFrom(logger Logger, values ...interface{}) Logger {
for _, value := range values {
switch v := value.(type) {
case Logger:
logger = logger.WithFields(v.Fields())
case Loggable:
logger = logger.WithFields(v.Log().Fields())
case interface{ Fields() Fields }:
logger = logger.WithFields(v.Fields())
}
}
return logger
}
Loading

0 comments on commit fbaca67

Please sign in to comment.