...

Package memory

import "github.com/gonitro/nitro/app/registry/memory"
Overview
Index

Overview ▾

Package memory provides an in-memory registry

func Apps

func Apps(s map[string][]*registry.App) registry.Option

Apps is an option that preloads service data

func NewTable

func NewTable(opts ...registry.Option) registry.Table

NewTable returns an initialized in-memory registry

type Table

type Table struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

func (*Table) Add

func (m *Table) Add(s *registry.App, opts ...registry.AddOption) error

func (*Table) Get

func (m *Table) Get(name string, opts ...registry.GetOption) ([]*registry.App, error)

func (*Table) Init

func (m *Table) Init(opts ...registry.Option) error

func (*Table) List

func (m *Table) List(opts ...registry.ListOption) ([]*registry.App, error)

func (*Table) Options

func (m *Table) Options() registry.Options

func (*Table) Remove

func (m *Table) Remove(s *registry.App, opts ...registry.RemoveOption) error

func (*Table) String

func (m *Table) String() string

func (*Table) Watch

func (m *Table) Watch(opts ...registry.WatchOption) (registry.Watcher, error)

type Watcher

type Watcher struct {
    // contains filtered or unexported fields
}

func (*Watcher) Next

func (m *Watcher) Next() (*registry.Result, error)

func (*Watcher) Stop

func (m *Watcher) Stop()