units

package
v0.0.0-...-34f79f7 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

This file is part of manifold. Manifold is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Manifold is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with manifold. If not, see <https://www.gnu.org/licenses/>.

This file is part of manifold. Manifold is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Manifold is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with manifold. If not, see <https://www.gnu.org/licenses/>.

This file is part of manifold. Manifold is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Manifold is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with manifold. If not, see <https://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogUnit

type LogUnit struct {
	LogLevel string
	// contains filtered or unexported fields
}

func NewLogUnit

func NewLogUnit(config LogUnitConfig) LogUnit

func (*LogUnit) Init

func (l *LogUnit) Init(context *UnitContext) error

func (*LogUnit) Run

func (l *LogUnit) Run(group *errgroup.Group, ctx context.Context) error

func (*LogUnit) Stop

func (l *LogUnit) Stop() error

type LogUnitConfig

type LogUnitConfig struct{}

type PingUnit

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

func NewPingUnit

func NewPingUnit(config PingUnitConfig) PingUnit

func (*PingUnit) Init

func (l *PingUnit) Init(context *UnitContext) error

func (*PingUnit) Run

func (p *PingUnit) Run(group *errgroup.Group, ctx context.Context) error

func (*PingUnit) Stop

func (l *PingUnit) Stop() error

type PingUnitConfig

type PingUnitConfig struct{}

type StrSlice

type StrSlice []string

func (StrSlice) Has

func (list StrSlice) Has(a string) bool

type Unit

type Unit interface {
	Init(context *UnitContext) error
	Run(group *errgroup.Group, ctx context.Context) error
	Stop() error
}

type UnitContext

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

func NewUnitContext

func NewUnitContext(name string,
	userIdDoNotGet []id.Id,
	userIdDoNotSend []id.Id,
	dblock chan *sql.DB,
	EventsChanSize int) UnitContext

func (*UnitContext) Bind

func (c *UnitContext) Bind(other *UnitContext)

func (*UnitContext) Close

func (c *UnitContext) Close()

func (*UnitContext) GetDb

func (c *UnitContext) GetDb() *sql.DB

func (*UnitContext) GetName

func (c *UnitContext) GetName() string

func (*UnitContext) Receiver

func (c *UnitContext) Receiver() events.EventChan

func (*UnitContext) RetDb

func (c *UnitContext) RetDb()

func (*UnitContext) Run

func (c *UnitContext) Run()

func (*UnitContext) Sender

func (c *UnitContext) Sender() events.EventChan

type UnitContextBuilder

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

func NewUnitContextBuilder

func NewUnitContextBuilder(db *sql.DB, eventsChanSize int) UnitContextBuilder

func (*UnitContextBuilder) Build

func (b *UnitContextBuilder) Build(Name string, BlockListInternal, BlockListExternal []id.Id) *UnitContext

Directories

Path Synopsis
This file is part of manifold.
This file is part of manifold.
This file is part of manifold.
This file is part of manifold.

Jump to

Keyboard shortcuts

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