types

package
v0.0.0-...-64a9ce5 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Method             = "Method"
	Mode               = "Mode"
	Stage              = "Stage"
	Ctx                = "Ctx"
	GCliReq            = "GCliReq"
	GBusRsp            = "GBusRsp"
	GCliRsps           = "GCliRsps"
	ForTypeNode        = "ForTypeNode"
	GBusReq            = "GBusReq"
	GSvcRsp            = "GSvcRsp"
	SvcFilter          = "SvcFilter"
	GRspSelect         = "GRspSelect"
	EndpointNode       = "EndpointNode"
	Svcs               = "Svcs"
	Svc                = "Svc"
	Errs               = "Errs"
	GEntity            = "GEntity"
	GEntities          = "GEntities"
	SvcId              = "SvcId"
	SvcIds             = "SvcIds"
	ClientAccount      = "ClientAccount"
	DoCliReqValidation = "DoCliReqValidation"
	DoCliReqProcessing = "DoCliReqProcessing"
)
View Source
const (
	CliReq = "client request"
	SvcReq = "service request"
	SvcRsp = "service response"
	CliRsp = "client response"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuthConfig

type BasicAuthConfig struct {
	User     string `yaml:"user,omitempty"`
	Password string `yaml:"password,omitempty"`
}

type Cache

type Cache interface {
	Add(key string, value interface{})
	Get(key string) (interface{}, bool)
}

type Config

type Config struct {
	DiscoverySvc    mql.Service                `yaml:"discoverySvc,omitempty"`
	Endpoints       EndpointsConfig            `yaml:"endpoints,omitempty"`
	Host            HostConfig                 `yaml:"host,omitempty"`
	Log             LogConfig                  `yaml:"log,omitempty"`
	Embedded        EmbeddedConfig             `yaml:"virtual,omitempty"`
	Internal        InternalConfig             `yaml:"internal,omitempty"`
	ServiceAccounts []ServiceAccountAssignment `yaml:"serviceAccounts,omitempty"`
}

type ConfigEndpointConfig

type ConfigEndpointConfig struct {
	On bool `yaml:"on,omitempty"`
}

type ContextInspect

type ContextInspect struct {
	Id        string
	Method    string
	Mode      string
	Type      string
	GCliReq   string
	GSvcReq   string
	GSvcRsp   string
	GCliRsp   string
	SvcFilter mql.ServiceFilter
	Svc       string
	Svcs      []string
}

type DebugEndpointConfig

type DebugEndpointConfig struct {
	On bool `yaml:"on,omitempty"`
}

type Dependencies

type Dependencies struct {
	RootNode             *graph.RootNode
	Factory              generic.Factory
	ResolveLine          Transformer
	ServeFunc            ServeFunc
	Router               http.Handler
	Routes               []Route
	InternalLogTemplates InternalLogTemplates
	Run                  []func() (err error)
}

type EmbeddedConfig

type EmbeddedConfig struct {
	Services []EmbeddedSvc
}

type EmbeddedSvc

type EmbeddedSvc struct {
	Id   string `yaml:"id,omitempty"`
	Name string `yaml:"name,omitempty"`
}

type EndpointsConfig

type EndpointsConfig struct {
	Config           ConfigEndpointConfig           `yaml:"config,omitempty"`
	Prometheus       PrometheusEndpointConfig       `yaml:"prometheus,omitempty"`
	Debug            DebugEndpointConfig            `yaml:"debug,omitempty"`
	Graphql          GraphqlEndpointConfig          `yaml:"graphql,omitempty"`
	GraphiqlExplorer GraphiqlExplorerEndpointConfig `yaml:"graphiqlExplorer,omitempty"`
	HttpJson         HttpJsonEndpoint               `yaml:"httpJson,omitempty"`
}

type FuncTransformer

type FuncTransformer struct {
	Name0 string
	Func  func(ctx ReqCtx) ReqCtx
}

func (FuncTransformer) Name

func (t FuncTransformer) Name() string

func (FuncTransformer) Transform

func (t FuncTransformer) Transform(ctx ReqCtx) ReqCtx

type GetConfig

type GetConfig struct {
	MaxResults  int
	ResolveById ResolveByIdConfig
}

type GlobalArgs

type GlobalArgs struct {
	VerbosityLevel int
	ConfigPath     string
}

type GraphiqlExplorerEndpointConfig

type GraphiqlExplorerEndpointConfig struct {
	On           bool   `yaml:"on,omitempty"`
	DefaultQuery string `yaml:"defaultQuery,omitempty"`
}

type GraphqlEndpointConfig

type GraphqlEndpointConfig struct {
	On bool `yaml:"on,omitempty"`
}

type HostConfig

type HostConfig struct {
	AllowedOrigins      []string        `yaml:"allowedOrigins,omitempty"`
	ReadTimeoutSeconds  int             `yaml:"readTimeoutSeconds,omitempty"`
	WriteTimeoutSeconds int             `yaml:"writeTimeoutSeconds,omitempty"`
	BasicAuth           BasicAuthConfig `yaml:"basicAuth,omitempty"`
}

type HttpJsonEndpoint

type HttpJsonEndpoint struct {
	On bool `yaml:"on,omitempty"`
}

type InternalConfig

type InternalConfig struct {
	Get GetConfig
}

type InternalLogConfig

type InternalLogConfig map[string]map[string]string

stage, type, format

type InternalLogData

type InternalLogData struct {
	Subject generic.Generic
	Ctx     ReqCtx
}

type InternalLogTemplates

type InternalLogTemplates map[string]map[string]*template.Template

type LogConfig

type LogConfig struct {
	Http     bool
	Internal InternalLogConfig
}

type PrometheusEndpointConfig

type PrometheusEndpointConfig struct {
	On bool `yaml:"on,omitempty"`
}

type ReqCtx

type ReqCtx struct {
	Id                 string
	Stage              string
	Method             string
	Mode               string
	Ctx                context.Context
	GCliReq            generic.Generic
	GBusRsp            generic.Generic
	GCliRsps           []generic.Generic
	ForTypeNode        *graph.TypeNode
	GBusReq            generic.Generic
	GSvcRsp            generic.Generic
	SvcFilter          *mql.ServiceFilter
	GRspSelect         generic.Generic
	EndpointNode       *graph.EndpointNode
	Svcs               []mql.Service
	Svc                *mql.Service
	Errs               []mql.Error
	GEntity            generic.Generic
	GEntities          generic.Slice
	SvcId              *mql.ServiceId
	SvcIds             []mql.ServiceId
	BusReqCtxs         []ReqCtx
	DoCliReqValidation bool
	DoCliReqProcessing bool
	DoSetClientAccount bool
}

func (ReqCtx) Copy

func (c ReqCtx) Copy() (ctx ReqCtx, err error)

func (ReqCtx) Inspect

func (c ReqCtx) Inspect()

func (ReqCtx) Sprint

func (c ReqCtx) Sprint() (s string)

type RequestHandler

type RequestHandler func(context.Context, string, generic.Generic) (generic.Generic, error)

type ResolveByIdConfig

type ResolveByIdConfig struct {
	Concurrency int
}

type ResolveFunc

type ResolveFunc func(ctx context.Context, doCliReqProcessing bool, doCliReqValidation bool, doSetClientAccount bool, gCliReq generic.Generic) (gCliRsp generic.Generic)

type Route

type Route struct {
	Methods     []string
	Path        string
	HandlerFunc http.HandlerFunc
	Handler     http.Handler
}

type ServeFunc

type ServeFunc func(ctx context.Context, gCliReq generic.Generic) (gCliRsp generic.Generic)

type ServiceAccountAssignment

type ServiceAccountAssignment struct {
	ServiceId      mql.ServiceId
	ServiceAccount mql.ServiceAccount
}

type Transformer

type Transformer interface {
	Name() string
	Transform(ctx ReqCtx) ReqCtx
}

type Version

type Version struct {
	Version string
	Commit  string
	Date    string
}

Jump to

Keyboard shortcuts

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