network

package
v0.0.0-...-1399f6c Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
}

Filter to filter network data.

func CreateFilter

func CreateFilter() *Filter

CreateFilter creates Filter.

func (*Filter) Filtering

func (f *Filter) Filtering(network resource.Resource, filtered chan resource.Resource, wg *sync.WaitGroup)

Filtering - only for VM relevant.

type NetUser

type NetUser struct {
	User                  *resources.User
	ActiveVirtualMachines []*resources.VirtualMachine
}

NetUser represents "Resource" with information about user and his active virtual machines.

func (*NetUser) Attribute

func (vnu *NetUser) Attribute(path string) (string, error)

Attribute gets user attribute given by path - relevant method to implement "Resource".

func (*NetUser) ID

func (vnu *NetUser) ID() (int, error)

ID gets user ID - relevant method to implement "Resource".

type Preparer

type Preparer struct {
	Writer writer.Writer
}

Preparer to prepare network data to specific structure for writing to Goat server.

func CreatePreparer

func CreatePreparer(limiter *rate.Limiter, conn *grpc.ClientConn) *Preparer

CreatePreparer creates Preparer for network records.

func (*Preparer) Finish

func (p *Preparer) Finish()

Finish gets to know to the Goat server that a writing is finished and a response is expected. Then, it closes the gRPC connection.

func (*Preparer) InitializeMaps

func (p *Preparer) InitializeMaps(wg *sync.WaitGroup)

InitializeMaps - only for VM relevant.

func (*Preparer) Preparation

func (p *Preparer) Preparation(acc resource.Resource, wg *sync.WaitGroup)

Preparation prepares network data for writing and call method to write.

func (*Preparer) SendIdentifier

func (p *Preparer) SendIdentifier() error

SendIdentifier sends identifier to Goat server.

type Processor

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

Processor to process network data.

func CreateProcessor

func CreateProcessor(r *reader.Reader) *Processor

CreateProcessor creates Processor to manage reading from OpenNebula.

func (*Processor) Process

func (p *Processor) Process(read chan resource.Resource, _ chan bool, swg *sizedwaitgroup.SizedWaitGroup)

Process provides listing of the users.

func (*Processor) RetrieveInfo

func (p *Processor) RetrieveInfo(fullInfo chan resource.Resource, wg *sync.WaitGroup, user resource.Resource)

RetrieveInfo about virtual machines specific for a given user.

type Writer

type Writer struct {
	Stream pb.AccountingService_ProcessIpsClient
	// contains filtered or unexported fields
}

Writer structure to write network data to Goat server.

func CreateWriter

func CreateWriter(limiter *rate.Limiter) *Writer

CreateWriter creates Writer for network data.

func (*Writer) Close

func (w *Writer) Close() (*empty.Empty, error)

Close gets to know to the goat server that a writing is finished and a response is expected.

func (*Writer) SendIdentifier

func (w *Writer) SendIdentifier() error

SendIdentifier sends identifier to Goat server.

func (*Writer) SetUp

func (w *Writer) SetUp(conn *grpc.ClientConn)

SetUp creates gRPC client and sets up Stream to process networks to Writer.

func (*Writer) Write

func (w *Writer) Write(record writer.Record) error

Write writes network record to Goat server.

Jump to

Keyboard shortcuts

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