service

package
v0.0.0-...-f54f16c Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Custom       = "Custom"
	Webhook      = "Webhook"
	Storage      = "Storage"
	S3           = "S3"
	Minio        = "Minio"
	BASIC_AUTH   = "basic_auth"
	SPLUNK_AUTH  = "splunk_auth"
	HEADER_AUTH  = "header_auth"
	STORAGE_AUTH = "storage_auth"
)
View Source
const CredentialsError = "Could not create credentials"

Variables

This section is empty.

Functions

func AddCustomHeader

func AddCustomHeader(credentials Credentials, header http.Header)

func ConnectAWS

func ConnectAWS(cred AwsCredentials, url string, service string) *session.Session

func FileUploadInAws

func FileUploadInAws(sess *session.Session, cred AwsCredentials, data []byte, FolderName string) (*s3manager.UploadOutput, error)

func Start

func Start(dataFeedConfig *config.DataFeedConfig, connFactory *secureconn.Factory, db *dao.DB) error

Types

type AuthTypes

type AuthTypes struct {
	AuthorizationHeader string
	HeaderJSONString    string
	AwsCreds            AwsCredentials
}

type AwsCredentials

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

func NewS3Credentials

func NewS3Credentials(AccessKey string, secretAccessKey string, region string, bucket string) AwsCredentials

func (AwsCredentials) GetAuthType

func (c AwsCredentials) GetAuthType() string

func (AwsCredentials) GetValues

func (c AwsCredentials) GetValues() AuthTypes

type BasicAuthCredentials

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

func NewBasicAuthCredentials

func NewBasicAuthCredentials(username string, password string) BasicAuthCredentials

func (BasicAuthCredentials) GetAuthType

func (c BasicAuthCredentials) GetAuthType() string

func (BasicAuthCredentials) GetValues

func (c BasicAuthCredentials) GetValues() AuthTypes

type Credentials

type Credentials interface {
	GetValues() AuthTypes
	GetAuthType() string
}

func GetCredentials

func GetCredentials(ctx context.Context, client secrets.SecretsServiceClient, secretID string, Services string, IntegrationType string, MetaData string) (Credentials, error)

type CredentialsFactory

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

func NewCredentialsFactory

func NewCredentialsFactory(data map[string]string) *CredentialsFactory

func (*CredentialsFactory) NewCredentials

func (c *CredentialsFactory) NewCredentials(data DBData) (Credentials, error)

type CustomHeaderCredentials

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

func NewCustomHeaderCredentials

func NewCustomHeaderCredentials(headers string) CustomHeaderCredentials

func (CustomHeaderCredentials) GetAuthType

func (c CustomHeaderCredentials) GetAuthType() string

func (CustomHeaderCredentials) GetValues

func (c CustomHeaderCredentials) GetValues() AuthTypes

type DBData

type DBData struct {
	Services        string
	IntegrationType string
	MetaData        string
}

type DataClient

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

func NewDataClient

func NewDataClient(statusCodes []int32) DataClient

type DataFeedAggregateTask

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

func NewDataFeedAggregateTask

func NewDataFeedAggregateTask(dataFeedConfig *config.DataFeedConfig, cfgMgmtConn *grpc.ClientConn, complianceConn *grpc.ClientConn, secretsConn *grpc.ClientConn, db *dao.DB) *DataFeedAggregateTask

func (*DataFeedAggregateTask) Run

func (d *DataFeedAggregateTask) Run(ctx context.Context, task cereal.Task) (interface{}, error)

type DataFeedAggregateTaskParams

type DataFeedAggregateTaskParams struct {
	NodeIDs          map[string]NodeIDs
	UpdatedNodesOnly bool
	FeedStart        time.Time
	FeedEnd          time.Time
}

type DataFeedPollTask

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

func NewDataFeedPollTask

func NewDataFeedPollTask(dataFeedConfig *config.DataFeedConfig, cfgMgmtConn *grpc.ClientConn, complianceConn *grpc.ClientConn, db *dao.DB, manager *cereal.Manager) (*DataFeedPollTask, error)

func (*DataFeedPollTask) GetChangedNodes

func (d *DataFeedPollTask) GetChangedNodes(ctx context.Context, pageSize int32, feedStartTime time.Time, feedEndTime time.Time) (map[string]NodeIDs, error)

GetChangedNodes calls the nodes API to get any nodes which have had a client run during the interval Returns a map of ipaddress to NodeIDs struct

func (*DataFeedPollTask) Run

func (d *DataFeedPollTask) Run(ctx context.Context, task cereal.Task) (interface{}, error)

type DataFeedPollTaskParams

type DataFeedPollTaskParams struct {
	AssetPageSize   int32
	ReportsPageSize int32
	FeedInterval    time.Duration
	FeedStart       time.Time
	FeedEnd         time.Time
}

type DataFeedPollTaskResults

type DataFeedPollTaskResults struct {
	NodeIDs   map[string]NodeIDs
	FeedStart time.Time
	FeedEnd   time.Time
}

type DataFeedWorkflowExecutor

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

func (*DataFeedWorkflowExecutor) OnCancel

func (*DataFeedWorkflowExecutor) OnStart

func (*DataFeedWorkflowExecutor) OnTaskComplete

type DataFeedWorkflowParams

type DataFeedWorkflowParams struct {
	FeedStart time.Time
	FeedEnd   time.Time
}

DataFeedWorkflowParams the params for the workflow and all the tasks in the workflow

type DataFeedWorkflowPayload

type DataFeedWorkflowPayload struct {
	NodeIDs      []map[string]NodeIDs
	NodeIDsIndex int
	FeedStart    time.Time
	FeedEnd      time.Time
}

type NodeIDs

type NodeIDs struct {
	ClientID     string
	ComplianceID string
}

ClientID the node ID assigned by chef client ComplianceID the node ID in a compliance report

type NotificationSender

type NotificationSender interface {
	// contains filtered or unexported methods
}

type SplunkAuthCredentials

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

func NewSplunkAuthCredentials

func NewSplunkAuthCredentials(splunkToken string) SplunkAuthCredentials

func (SplunkAuthCredentials) GetAuthType

func (c SplunkAuthCredentials) GetAuthType() string

func (SplunkAuthCredentials) GetValues

func (c SplunkAuthCredentials) GetValues() AuthTypes

Jump to

Keyboard shortcuts

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