core

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 7 Imported by: 2

README

Go Reference GitHub go.mod Go version GitHub release (latest by date) Go Report Card Actions Status

HomeOffice Button - Core Components

Tis repository contains some core components for the HomeOffice Button - Time Tracking Project.

Events

Events are defined using Protobuf and will be automatically generate Go sources.

GenerateReportRequest

This event is used to trigger report generattion from different sources.

Helper

This package provides serialize/deserialize helper to publish and consume events in Protobuf format.

HomeOffice Button - Time Tracking
AWS IoT 1-Click

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReportType_name = map[int32]string{
		0: "NO_TYPE",
		1: "MONTHLY_REPORT",
	}
	ReportType_value = map[string]int32{
		"NO_TYPE":        0,
		"MONTHLY_REPORT": 1,
	}
)

Enum value maps for ReportType.

View Source
var (
	ReportFormat_name = map[int32]string{
		0: "NO_FORMAT",
		1: "EXCEL",
	}
	ReportFormat_value = map[string]int32{
		"NO_FORMAT": 0,
		"EXCEL":     1,
	}
)

Enum value maps for ReportFormat.

View Source
var File_GenerateReportRequest_proto protoreflect.FileDescriptor

Functions

func DeserializeEvent added in v1.0.1

func DeserializeEvent(data string, event proto.Message) error

DeserializeEvent wil try to unmarshal given event data to passed event.

func SerializeEvent added in v1.0.1

func SerializeEvent(event proto.Message) (string, error)

SerializeEvent uses protobuf to marshal given event

Types

type FileTarget added in v1.0.3

type FileTarget struct {

	// Path defines localtion where a file should be placed.
	Path string `protobuf:"bytes,1,opt,name=Path,proto3" json:"Path,omitempty"`
	// contains filtered or unexported fields
}

FileTarget contains settings to write a report to a local file.

func (*FileTarget) Descriptor deprecated added in v1.0.3

func (*FileTarget) Descriptor() ([]byte, []int)

Deprecated: Use FileTarget.ProtoReflect.Descriptor instead.

func (*FileTarget) GetPath added in v1.0.4

func (x *FileTarget) GetPath() string

func (*FileTarget) ProtoMessage added in v1.0.3

func (*FileTarget) ProtoMessage()

func (*FileTarget) ProtoReflect added in v1.0.3

func (x *FileTarget) ProtoReflect() protoreflect.Message

func (*FileTarget) Reset added in v1.0.3

func (x *FileTarget) Reset()

func (*FileTarget) String added in v1.0.3

func (x *FileTarget) String() string

type GenerateReportRequest

type GenerateReportRequest struct {

	// Format a report should be generated in.
	Format ReportFormat `protobuf:"varint,1,opt,name=Format,proto3,enum=core.ReportFormat" json:"Format,omitempty"`
	// Type defines which kind of report should be generated.
	Type ReportType `protobuf:"varint,2,opt,name=Type,proto3,enum=core.ReportType" json:"Type,omitempty"`
	// Year a report shoul be generated for.
	Year int64 `protobuf:"varint,3,opt,name=Year,proto3" json:"Year,omitempty"`
	// Month a report shoul be generated for.
	Month int64 `protobuf:"varint,4,opt,name=Month,proto3" json:"Month,omitempty"`
	// NamePattern defined a template for report file names.
	NamePattern string `protobuf:"bytes,5,opt,name=NamePattern,proto3" json:"NamePattern,omitempty"`
	// Delivery defines targets a eport should be send to.
	Delivery *ReportDelivery `protobuf:"bytes,6,opt,name=Delivery,proto3" json:"Delivery,omitempty"`
	// DeviceIds is a list of devices if which captured time tracking records should
	// be used to generate a report.
	DeviceIds []string `protobuf:"bytes,7,rep,name=DeviceIds,proto3" json:"DeviceIds,omitempty"`
	// contains filtered or unexported fields
}

GenerateReportRequest is used to trigger report generation.

func (*GenerateReportRequest) Descriptor deprecated

func (*GenerateReportRequest) Descriptor() ([]byte, []int)

Deprecated: Use GenerateReportRequest.ProtoReflect.Descriptor instead.

func (*GenerateReportRequest) GetDelivery

func (x *GenerateReportRequest) GetDelivery() *ReportDelivery

func (*GenerateReportRequest) GetDeviceIds added in v1.0.5

func (x *GenerateReportRequest) GetDeviceIds() []string

func (*GenerateReportRequest) GetFormat

func (x *GenerateReportRequest) GetFormat() ReportFormat

func (*GenerateReportRequest) GetMonth

func (x *GenerateReportRequest) GetMonth() int64

func (*GenerateReportRequest) GetNamePattern

func (x *GenerateReportRequest) GetNamePattern() string

func (*GenerateReportRequest) GetType

func (x *GenerateReportRequest) GetType() ReportType

func (*GenerateReportRequest) GetYear

func (x *GenerateReportRequest) GetYear() int64

func (*GenerateReportRequest) ProtoMessage

func (*GenerateReportRequest) ProtoMessage()

func (*GenerateReportRequest) ProtoReflect

func (x *GenerateReportRequest) ProtoReflect() protoreflect.Message

func (*GenerateReportRequest) Reset

func (x *GenerateReportRequest) Reset()

func (*GenerateReportRequest) String

func (x *GenerateReportRequest) String() string

type MailTarget

type MailTarget struct {

	// ToAddresses provides a list of email receiver.
	ToAddresses []string `protobuf:"bytes,1,rep,name=ToAddresses,proto3" json:"ToAddresses,omitempty"`
	// contains filtered or unexported fields
}

MailTarget contains settings for mail delivery.

func (*MailTarget) Descriptor deprecated

func (*MailTarget) Descriptor() ([]byte, []int)

Deprecated: Use MailTarget.ProtoReflect.Descriptor instead.

func (*MailTarget) GetToAddresses

func (x *MailTarget) GetToAddresses() []string

func (*MailTarget) ProtoMessage

func (*MailTarget) ProtoMessage()

func (*MailTarget) ProtoReflect

func (x *MailTarget) ProtoReflect() protoreflect.Message

func (*MailTarget) Reset

func (x *MailTarget) Reset()

func (*MailTarget) String

func (x *MailTarget) String() string

type ReportDelivery

type ReportDelivery struct {

	// S3 defeines target bucket in AWS S4 a report should be uploaded to.
	S3 *S3Target `protobuf:"bytes,1,opt,name=S3,proto3" json:"S3,omitempty"`
	// Mail defines settings to send a report via email.
	Mail *MailTarget `protobuf:"bytes,2,opt,name=Mail,proto3" json:"Mail,omitempty"`
	// File defines settings to write reports to a local file.
	File *FileTarget `protobuf:"bytes,3,opt,name=File,proto3" json:"File,omitempty"`
	// contains filtered or unexported fields
}

ReportDelivery defines different targets a report can be disributed to.

func (*ReportDelivery) Descriptor deprecated

func (*ReportDelivery) Descriptor() ([]byte, []int)

Deprecated: Use ReportDelivery.ProtoReflect.Descriptor instead.

func (*ReportDelivery) GetFile added in v1.0.3

func (x *ReportDelivery) GetFile() *FileTarget

func (*ReportDelivery) GetMail

func (x *ReportDelivery) GetMail() *MailTarget

func (*ReportDelivery) GetS3

func (x *ReportDelivery) GetS3() *S3Target

func (*ReportDelivery) ProtoMessage

func (*ReportDelivery) ProtoMessage()

func (*ReportDelivery) ProtoReflect

func (x *ReportDelivery) ProtoReflect() protoreflect.Message

func (*ReportDelivery) Reset

func (x *ReportDelivery) Reset()

func (*ReportDelivery) String

func (x *ReportDelivery) String() string

type ReportFormat

type ReportFormat int32

ReportFormat defines the format a report should be generated.

const (
	ReportFormat_NO_FORMAT ReportFormat = 0
	ReportFormat_EXCEL     ReportFormat = 1
)

func (ReportFormat) Descriptor

func (ReportFormat) Enum

func (x ReportFormat) Enum() *ReportFormat

func (ReportFormat) EnumDescriptor deprecated

func (ReportFormat) EnumDescriptor() ([]byte, []int)

Deprecated: Use ReportFormat.Descriptor instead.

func (ReportFormat) Number

func (ReportFormat) String

func (x ReportFormat) String() string

func (ReportFormat) Type

type ReportType

type ReportType int32

ReportType defines which kind of report should be generated.

const (
	ReportType_NO_TYPE        ReportType = 0
	ReportType_MONTHLY_REPORT ReportType = 1
)

func (ReportType) Descriptor

func (ReportType) Descriptor() protoreflect.EnumDescriptor

func (ReportType) Enum

func (x ReportType) Enum() *ReportType

func (ReportType) EnumDescriptor deprecated

func (ReportType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ReportType.Descriptor instead.

func (ReportType) Number

func (x ReportType) Number() protoreflect.EnumNumber

func (ReportType) String

func (x ReportType) String() string

func (ReportType) Type

type S3Target

type S3Target struct {

	// Region is a AWS region of a S3 bucket.
	Region string `protobuf:"bytes,1,opt,name=Region,proto3" json:"Region,omitempty"`
	// Bucket defines the name of a S3 bucket.
	Bucket string `protobuf:"bytes,2,opt,name=Bucket,proto3" json:"Bucket,omitempty"`
	// Path defines a optional prefix path.
	Path string `protobuf:"bytes,3,opt,name=Path,proto3" json:"Path,omitempty"`
	// contains filtered or unexported fields
}

S3Target defines settings to upload a report to an AWS S3 bucket.

func (*S3Target) Descriptor deprecated

func (*S3Target) Descriptor() ([]byte, []int)

Deprecated: Use S3Target.ProtoReflect.Descriptor instead.

func (*S3Target) GetBucket

func (x *S3Target) GetBucket() string

func (*S3Target) GetPath

func (x *S3Target) GetPath() string

func (*S3Target) GetRegion

func (x *S3Target) GetRegion() string

func (*S3Target) ProtoMessage

func (*S3Target) ProtoMessage()

func (*S3Target) ProtoReflect

func (x *S3Target) ProtoReflect() protoreflect.Message

func (*S3Target) Reset

func (x *S3Target) Reset()

func (*S3Target) String

func (x *S3Target) String() string

Jump to

Keyboard shortcuts

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