Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

random-ru/vault-csharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✨ Vault library for C# ✨

Nuget Telegram

Remark:
This project is part of a project Vault

Install

dotnet add package ivy.vault --version 1.0.0

API

Get Field

// app: market
// space: coop
// fullpath: /@/coop/market/prices
// auth: NO

using var vault = Vault
    .Create("vault.api")
    .Space("coop")
    .App("market");

var prices = await vault.FieldAsync<Price[]>("prices");

Update Field

// app: market
// space: coop
// fullpath: /@/coop/market/features
// auth: NO

using var vault = Vault
    .Create("vault.api")
    .Space("coop")
    .App("market");

var features = await vault.FieldAsync<List<FeatureFlag>>("features");

features.RemoveWhen(x => x.name == "task");


await vault.UpdateAsync("features", features);

With autorization

// app: market
// space: coop
// fullpath: /@/coop/market/prices
// auth: YES

using var vault = Vault
    .Create("vault.api")
    .Space("coop")
    .WithToken(SPACE_TOKEN)
    .App("market")
    .WithToken(APP_TOKEN);

var prices = await vault.FieldAsync<Price[]>("prices");

Errors

class VaultBadRequestException   // Application or Field path not found.
class VaultAccessDeniedException // Access Code is not correct.