ws

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTP_AUTH_TYPE_BASIC  = "basic"
	HTTP_AUTH_TYPE_SAT    = "sat"
	HTTP_AUTH_TYPE_OAUTH  = "oauth"
	HTTP_AUTH_TYPE_OAUTH2 = "oauth2"

	SAT_URL = "https://sat-prod.codebig2.net/oauth/token"
)

Variables

View Source
var DefaultConfig = Config{
	ToPath:                 "",
	FromPath:               "",
	Url:                    "",
	UrlPath:                "",
	Method:                 "GET",
	Body:                   "",
	Headers:                map[string]string{},
	EmptyPathValueRequired: pointer.Bool(false),
	Auth:                   &Auth{},
}

Functions

func InitHttpTransportWithDialer added in v1.1.0

func InitHttpTransportWithDialer() *http.Client

Types

type Auth

type Auth struct {
	Type         string   `json:"type,omitempty"`
	Username     string   `json:"username,omitempty"`     // basic auth
	Password     string   `json:"password,omitempty"`     // basic auth
	ClientID     string   `json:"clientId,omitempty"`     // oauth2
	ClientSecret string   `json:"clientSecret,omitempty"` // oauth2
	TokenURL     string   `json:"tokenUrl,omitempty"`     // oauth2
	Scopes       []string `json:"scopes,omitempty"`       // oauth2
}

type Config

type Config struct {
	ToPath                 string            `json:"toPath,omitempty"`
	FromPath               string            `json:"fromPath,omitempty"`
	Url                    string            `json:"url,omitempty"`
	UrlPath                string            `json:"urlPath,omitempty"`
	Method                 string            `json:"method,omitempty"`
	Body                   string            `json:"body,omitempty"`
	Headers                map[string]string `json:"headers,omitempty"`
	EmptyPathValueRequired *bool             `json:"emptyPathValueRequired,omitempty"`
	Auth                   *Auth             `json:"auth,omitempty"`
}

Config can be passed into NewFilter() in order to configure the behavior of the sender.

func NewConfig

func NewConfig(config interface{}) (*Config, error)

func (*Config) FromJSON

func (c *Config) FromJSON(in string) error

func (*Config) FromYAML

func (c *Config) FromYAML(in string) error

func (*Config) JSON

func (c *Config) JSON() (string, error)

func (*Config) String

func (c *Config) String() string

func (*Config) Validate

func (c *Config) Validate() error

func (Config) WithDefaults

func (c Config) WithDefaults() *Config

func (*Config) YAML

func (c *Config) YAML() (string, error)

type Filter

type Filter struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewFilter

func NewFilter(tid tenant.Id, plugin string, name string, config interface{}, secrets secret.Vault, tableSyncer syncer.DeltaSyncer) (*Filter, error)

func (*Filter) Config

func (f *Filter) Config() interface{}

func (*Filter) EventErrorCount added in v1.1.2

func (f *Filter) EventErrorCount() int

func (*Filter) EventErrorVelocity added in v1.1.2

func (f *Filter) EventErrorVelocity() int

func (*Filter) EventFilterCount added in v1.1.2

func (f *Filter) EventFilterCount() int

func (*Filter) EventFilterVelocity added in v1.1.2

func (f *Filter) EventFilterVelocity() int

func (*Filter) EventSuccessCount added in v1.1.2

func (f *Filter) EventSuccessCount() int

func (*Filter) EventSuccessVelocity added in v1.1.2

func (f *Filter) EventSuccessVelocity() int

func (*Filter) EventTs added in v1.1.2

func (f *Filter) EventTs() int64

func (*Filter) Filter

func (f *Filter) Filter(evt event.Event) []event.Event

func (*Filter) Hash added in v1.1.2

func (f *Filter) Hash() string

func (*Filter) Name

func (f *Filter) Name() string

func (*Filter) Plugin

func (f *Filter) Plugin() string

func (*Filter) Tenant

func (f *Filter) Tenant() tenant.Id

type SatToken added in v1.1.2

type SatToken struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
	Scope       string `json:"scope"`
	TokenType   string `json:"token_type"`
	ExpiresAt   int64  `json:"timestamp"`
}

Jump to

Keyboard shortcuts

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