realm

package
v0.0.0-...-7d41a23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package realm regroups all infra (driven-side) implementations of the realm domain.

Index

Constants

View Source
const Version string = "v1.beta"

Version of the YAML strcuture

Variables

This section is empty.

Functions

This section is empty.

Types

type YAMLRealm

type YAMLRealm struct {
	ID       string `yaml:"id"`
	URL      string `yaml:"url"`
	Username string `yaml:"username"`
}

YAMLRealm defines how to store a realm in YAML format

type YAMLStorage

type YAMLStorage struct{}

YAMLStorage provides storage in a local YAML file

func NewYAMLStorage

func NewYAMLStorage() YAMLStorage

NewYAMLStorage create a new YAML storage

func (YAMLStorage) CreateOrUpdateRealm

func (s YAMLStorage) CreateOrUpdateRealm(r realm.Realm) error

CreateOrUpdateRealm in the local YAML file

func (YAMLStorage) DeleteRealm

func (s YAMLStorage) DeleteRealm(id string) error

DeleteRealm remove the realm with id from the local storage.

func (YAMLStorage) GetRealm

func (s YAMLStorage) GetRealm(id string) (realm.Realm, error)

GetRealm from the local YAML file

func (YAMLStorage) ListRealms

func (s YAMLStorage) ListRealms() (realm.List, error)

ListRealms contained in the local YAML file

type YAMLStructure

type YAMLStructure struct {
	Version string      `yaml:"version"`
	Realms  []YAMLRealm `yaml:"realms,omitempty"`
}

YAMLStructure of the file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL