services

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2019 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const CTRL_BASEURL string = `/_`
View Source
const DEFAULT_PORT uint = 17779
View Source
const EXEC_BASEURL string = `/$`
View Source
const EXEC_BASEURL_DEPRECATED string = `/run`
View Source
const OPWIRE_EDITION_PREFIX string = "OPWIRE_EDITION"
View Source
const OPWIRE_EDITION_PREFIX_PLUS string = OPWIRE_EDITION_PREFIX + "="
View Source
const OPWIRE_REQUEST_PREFIX string = "OPWIRE_REQUEST"
View Source
const OPWIRE_REQUEST_PREFIX_PLUS string = OPWIRE_REQUEST_PREFIX + "="
View Source
const OPWIRE_SETTINGS_PREFIX string = "OPWIRE_SETTINGS"
View Source
const OPWIRE_SETTINGS_PREFIX_PLUS string = OPWIRE_SETTINGS_PREFIX + "="
View Source
const REQ_HEADER_EXECUTION_TIMEOUT string = "Opwire-Execution-Timeout"
View Source
const REQ_HEADER_EXPLAIN_FAILURE string = "Opwire-Explain-Failure"
View Source
const REQ_HEADER_EXPLAIN_SUCCESS string = "Opwire-Explain-Success"
View Source
const REQ_HEADER_REQUEST_ID_NAME string = "Opwire-Request-Id"
View Source
const REQ_HEADER_SUPPRESS_EXECUTION string = "Opwire-Suppress-Running"
View Source
const RES_HEADER_ERROR_MESSAGE string = "X-Error-Message"
View Source
const RES_HEADER_EXEC_DURATION string = "X-Exec-Duration"

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentServer

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

func NewAgentServer

func NewAgentServer(o AgentServerOptions) (s *AgentServer, err error)

func (*AgentServer) Shutdown

func (s *AgentServer) Shutdown() error

func (*AgentServer) Start

func (s *AgentServer) Start() error

type AgentServerOptions added in v1.0.7

type AgentServerOptions interface {
	GetConfigPath() string
	GetDirectCommand() string
	GetHost() string
	GetPort() uint
	GetStaticPath() map[string]string
	SuppressAutoStart() bool
	GetRevision() string
	GetVersion() string
}

type CommandExecutor added in v1.0.4

type CommandExecutor interface {
	Register(descriptor *invokers.CommandDescriptor, names ...string) error
	ResolveCommandDescriptor(opts *invokers.CommandInvocation) (descriptor *invokers.CommandDescriptor, resourceName *string, methodName *string, err error)
	GetSettings(resourceName string) []string
	StoreSettings(prefix string, settings map[string]interface{}, format string, resourceName string) error
	Run(io.Reader, *invokers.CommandInvocation, io.Writer, io.Writer) (*invokers.ExecutionState, error)
}

type Map

type Map = map[string]interface{}

type ReqRestrictor added in v1.0.7

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

func NewReqRestrictor added in v1.0.7

func NewReqRestrictor(logger *loq.Logger, opts ReqRestrictorOptions) (*ReqRestrictor, error)

func (*ReqRestrictor) Acquire added in v1.0.7

func (rr *ReqRestrictor) Acquire(weight int) error

func (*ReqRestrictor) Digest added in v1.0.7

func (rr *ReqRestrictor) Digest(r *http.Request) string

func (*ReqRestrictor) Filter added in v1.0.7

func (rr *ReqRestrictor) Filter(groupKey string, action func() (interface{}, error)) (interface{}, error, bool)

func (*ReqRestrictor) FilterByDigest added in v1.0.7

func (rr *ReqRestrictor) FilterByDigest(r *http.Request, action func() (interface{}, error)) (interface{}, error, bool)

func (*ReqRestrictor) HasSemaphore added in v1.0.7

func (rr *ReqRestrictor) HasSemaphore() bool

func (*ReqRestrictor) HasSingleFlight added in v1.0.7

func (rr *ReqRestrictor) HasSingleFlight() bool

func (*ReqRestrictor) LogResult added in v1.0.7

func (rr *ReqRestrictor) LogResult(groupKey string, state interface{}, err error, shared bool) (interface{}, error, bool)

func (*ReqRestrictor) Release added in v1.0.7

func (rr *ReqRestrictor) Release(weight int)

type ReqRestrictorOptions added in v1.0.7

type ReqRestrictorOptions interface {
	ConcurrentLimitEnabled() bool
	ConcurrentLimitTotal() int
	SingleFlightEnabled() bool
	SingleFlightReqIdName() string
	SingleFlightByMethod() bool
	SingleFlightByPath() bool
	SingleFlightByBody() bool
	SingleFlightByHeaders() []string
	SingleFlightByQueries() []string
	SingleFlightByUserIP() bool
}

type ReqSerializer

type ReqSerializer struct{}

func NewReqSerializer

func NewReqSerializer() (*ReqSerializer, error)

func (*ReqSerializer) Decode

func (s *ReqSerializer) Decode(data []byte) (*RequestPacket, error)

func (*ReqSerializer) Encode

func (s *ReqSerializer) Encode(r *http.Request, fromExecUrl bool) ([]byte, error)

type RequestPacket

type RequestPacket struct {
	Method *string           `json:"method"`
	Path   *string           `json:"path"`
	Header http.Header       `json:"header"`
	Query  url.Values        `json:"query"`
	Params map[string]string `json:"params"`
}

type SingleFlightPattern added in v1.0.7

type SingleFlightPattern struct {
	ReqIdName  string
	HasMethod  bool
	HasPath    bool
	HasHeaders []string
	HasQueries []string
	HasBody    bool
	HasUserIP  bool
}

type StateStore

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

func NewStateStore

func NewStateStore() (*StateStore, error)

func (*StateStore) Get

func (ss *StateStore) Get(key string) interface{}

func (*StateStore) GetAsJSON

func (ss *StateStore) GetAsJSON(key string) ([]byte, error)

func (*StateStore) Store

func (ss *StateStore) Store(key string, val interface{}) *StateStore

type TextFormatter added in v1.0.8

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

func NewTextFormatter added in v1.0.8

func NewTextFormatter(options TextFormatterOptions) *TextFormatter

func (*TextFormatter) PrintCollection added in v1.0.8

func (p *TextFormatter) PrintCollection(w http.ResponseWriter, label string, listData []string)

func (*TextFormatter) PrintJsonObject added in v1.0.8

func (p *TextFormatter) PrintJsonObject(w http.ResponseWriter, label string, hashData map[string]interface{}) error

func (*TextFormatter) PrintJsonString added in v1.0.8

func (p *TextFormatter) PrintJsonString(w http.ResponseWriter, label string, textData string) error

func (*TextFormatter) PrintTextgraph added in v1.0.8

func (p *TextFormatter) PrintTextgraph(w http.ResponseWriter, label string, data interface{})

type TextFormatterOptions added in v1.0.8

type TextFormatterOptions interface {
	GetFormat() string
}

Jump to

Keyboard shortcuts

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