Search results
Viber is a communication app that lets you call and chat with anyone, anywhere. It also offers stickers, GIFs, communities and security features.
- Download
To activate Viber for Desktop, you will need an active Viber...
- Brand Center
Color palette. In total, our color palette consists of 9...
- Security
We canโt and donโt sell what you share. When your chats are...
- Features
Multiplatform. Always Synced. Mobile, tablet and desktop -...
- Ads Policy
Ads Policy - Home | Viber
- Careers
Find Your Next Team. Israel; Belarus; Georgia; Worldwide;...
- Terms & Policies
Here youโll find all the legal terms and facts you need,...
- Blog
Introducing Rakuten Viberโs AI Chat Summary TL;DR. You...
- Download
To activate Viber for Desktop, you will need an active Viber account on your mobile phone. Download for Windows Download Viber for 64-bit version of Windows 10, Windows 11 and Windows 11 on ARM. Need help?
VIPER CHALLENGE: Asia's biggest obstacle event series with world-class challenges. Join now and push your limits. Sign up today!
- Viper v2 feedback
- Install
- What is Viper?
- Why Viper?
- Putting Values into Viper
- Getting Values From Viper
- Viper or Vipers?
- Q & A
- Development
- GeneratedCaptionsTabForHeroSec
Viper is heading towards v2 and we would love to hear what you would like to see in it. Share your thoughts here: https://forms.gle/R6faU74qPRPAzchZ9
Thank you!
Go configuration with fangs!
Many Go projects are built using Viper including:
โขHugo
โขEMC RexRay
Note: Viper uses Go Modules to manage dependencies.
Viper is a complete configuration solution for Go applications including 12-Factor apps. It is designed to work within an application, and can handle all types of configuration needs and formats. It supports:
โขsetting defaults
โขreading from JSON, TOML, YAML, HCL, envfile and Java properties config files
โขlive watching and re-reading of config files (optional)
โขreading from environment variables
โขreading from remote config systems (etcd or Consul), and watching changes
When building a modern application, you donโt want to worry about configuration file formats; you want to focus on building awesome software. Viper is here to help with that.
Viper does the following for you:
1.Find, load, and unmarshal a configuration file in JSON, TOML, YAML, HCL, INI, envfile or Java properties formats.
2.Provide a mechanism to set default values for your different configuration options.
3.Provide a mechanism to set override values for options specified through command line flags.
4.Provide an alias system to easily rename parameters without breaking existing code.
Establishing Defaults
A good configuration system will support default values. A default value is not required for a key, but itโs useful in the event that a key hasn't been set via config file, environment variable, remote configuration or flag. Examples:
Reading Config Files
Viper requires minimal configuration so it knows where to look for config files. Viper supports JSON, TOML, YAML, HCL, INI, envfile and Java Properties files. Viper can search multiple paths, but currently a single Viper instance only supports a single configuration file. Viper does not default to any configuration search paths leaving defaults decision to an application. Here is an example of how to use Viper to search for and read a configuration file. None of the specific paths are required, but at least one path should be provided where a configuration file is expected. You can handle the specific case where no config file is found like this: NOTE [since 1.6]: You can also have a file without an extension and specify the format programmatically. For those configuration files that lie in the home of the user without any extension like .bashrc
Writing Config Files
Reading from config files is useful, but at times you want to store all modifications made at run time. For that, a bunch of commands are available, each with its own purpose: โขWriteConfig - writes the current viper configuration to the predefined path, if exists. Errors if no predefined path. Will overwrite the current config file, if it exists. โขSafeWriteConfig - writes the current viper configuration to the predefined path. Errors if no predefined path. Will not overwrite the current config file, if it exists. โขWriteConfigAs - writes the current viper configuration to the given filepath. Will overwrite the given file, if it exists. โขSafeWriteConfigAs - writes the current viper configuration to the given filepath. Will not overwrite the given file, if it exists. As a rule of the thumb, everything marked with safe won't overwrite any file, but just create if not existent, whilst the default behavior is to create or truncate. A small examples section:
In Viper, there are a few ways to get a value depending on the valueโs type. The following functions and methods exist:
โขGet(key string) : any
โขGetBool(key string) : bool
โขGetFloat64(key string) : float64
โขGetInt(key string) : int
โขGetIntSlice(key string) : []int
Viper comes ready to use out of the box. There is no configuration or initialization needed to begin using Viper. Since most applications will want to use a single central repository for their configuration, the viper package provides this. It is similar to a singleton.
In all of the examples above, they demonstrate using viper in its singleton style approach.
Why is it called โViperโ?
A: Viper is designed to be a companion to Cobra. While both can operate completely independently, together they make a powerful pair to handle much of your application foundation needs.
Why is it called โCobraโ?
Is there a better name for a commander?
Does Viper support case sensitive keys?
tl;dr: No. Viper merges configuration from various sources, many of which are either case insensitive or uses different casing than the rest of the sources (eg. env vars). In order to provide the best experience when using multiple sources, the decision has been made to make all keys case insensitive. There has been several attempts to implement case sensitivity, but unfortunately it's not that trivial. We might take a stab at implementing it in Viper v2, but despite the initial noise, it does not seem to be requested that much. You can vote for case sensitivity by filling out this feedback form: https://forms.gle/R6faU74qPRPAzchZ9
For an optimal developer experience, it is recommended to install Nix and direnv.
Alternatively, install Go on your computer then run make deps to install the rest of the dependencies.
Run the test suite:
Run linters:
Viper is a complete configuration solution for Go applications that supports various formats and sources. Learn how to use Viper to set defaults, read config files, handle command line flags, and more.
Vipera berus, also known as the common European adder and the common European viper, is a species of venomous snake in the family Viperidae. The species is extremely widespread and can be found throughout much of Europe, and as far as East Asia. There are three recognised subspecies.
Learn about viper, a family of more than 200 species of venomous snakes with fangs and pit organs. Find out how vipers hunt, envenomate, and vary in size, habitat, and distribution.
Viper is the world's best selling vehicle security and remote start brand. We use cutting-edge technology to make sure you are in control, providing range and features you can count on every time.