actors

package
v0.0.0-...-f267496 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorAPIService

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

ActorAPIService is the implementation auf the audit service

func NewActorAPIService

func NewActorAPIService(block bool) (service *ActorAPIService, err error)

NewActorAPIService initializes the instance of the audit service

func (*ActorAPIService) Close

func (service *ActorAPIService) Close() error

Close stops the audit service

type ActorDAO

type ActorDAO struct {
	DB *sqlx.DB
}

ActorDAO is the interface to the DB Storage operations for the Actor API

func (ActorDAO) AddAudit

func (dao ActorDAO) AddAudit(audit *Audit) error

AddAudit adds a new audit entry to the database

func (ActorDAO) GetMessages

func (dao ActorDAO) GetMessages(context string, messageTypes []string) (messages []Message, err error)

GetMessages queries messages from the database based on the input parameters

type Audit

type Audit struct {
	DataSource
	Event string    `json:"event"`
	Stamp time.Time `json:"stamp"`

	Message *Message `json:"message,omitempty"`
	Data    *string  `json:"data,omitempty"`
}

Audit message

type DataSource

type DataSource struct {
	Host
	Actor string `json:"actor"`
	Phase string `json:"phase"`
}

DataSource specifies the origin of the message

type Host

type Host struct {
	Context  string `json:"context"`
	Hostname string `json:"hostname"`
}

Host specifies the host the message comes from

type LogMessage

type LogMessage struct {
	DataSource
	Stamp time.Time `json:"stamp"`
	Log   struct {
		Level   string `json:"level"`
		Message string `json:"message"`
	} `json:"log"`
}

LogMessage a log message sent

type Message

type Message struct {
	DataSource
	ID      int64       `json:"id"`
	Stamp   time.Time   `json:"stamp"`
	Type    string      `json:"type"`
	Channel string      `json:"channel"`
	Message MessageData `json:"message"`
}

Message is a channel message

type MessageData

type MessageData struct {
	Hash string `json:"hash"`
	Data string `json:"data"`
}

MessageData contains the data of the message and its hash

Jump to

Keyboard shortcuts

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