saaras

package
v0.1.1-0...-bbaa227 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const QGatewayHost string = `` /* 3329-byte string literal not displayed */
View Source
const QProxyGroupCfg string = `` /* 247-byte string literal not displayed */
View Source
const QUpstreams string = `` /* 463-byte string literal not displayed */

Variables

View Source
var ENROUTE_CP_PROTO string
View Source
var ENROUTE_CP_SERVER_IP string
View Source
var ENROUTE_CP_SERVER_PORT string
View Source
var ENROUTE_NAME string

Functions

func FetchConfig

func FetchConfig(query string, buf *bytes.Buffer, args map[string]string, log logrus.FieldLogger) error

Used by enroute-dp

func RunDBQuery

func RunDBQuery(url string, query string, buf *bytes.Buffer, args map[string]string, log logrus.FieldLogger) error

Used by webapp

func RunDBQueryGenericVals

func RunDBQueryGenericVals(url string, query string, buf *bytes.Buffer, args map[string]interface{}, log logrus.FieldLogger) error

func Saaras_ir__to__v1b1_ir2

func Saaras_ir__to__v1b1_ir2(sir *SaarasGatewayHostService) *v1.GatewayHost

func Saaras_secret__to__v1_secret

func Saaras_secret__to__v1_secret(secrets *[]Secret) *[]v1.Secret

Types

type Client

type Client struct {

	// Log is called with various debug information.
	// To log to standard out, use:
	//  client.Log = func(s string) { log.Println(s) }
	Log func(s string)
	// contains filtered or unexported fields
}

Client is a client for interacting with a GraphQL API.

func NewClient

func NewClient(endpoint string, opts ...ClientOption) *Client

NewClient makes a new Client capable of making GraphQL requests.

func (*Client) Run

func (c *Client) Run(ctx context.Context, req *Request, gr *bytes.Buffer) error

type ClientOption

type ClientOption func(*Client)

ClientOption are functions that are passed into NewClient to modify the behaviour of the Client.

func ImmediatelyCloseReqBody

func ImmediatelyCloseReqBody() ClientOption

ImmediatelyCloseReqBody will close the req body immediately after each request body is ready

func UseMultipartForm

func UseMultipartForm() ClientOption

UseMultipartForm uses multipart/form-data and activates support for files.

func WithHTTPClient

func WithHTTPClient(httpclient *http.Client) ClientOption

WithHTTPClient specifies the underlying http.Client to use when making requests.

NewClient(endpoint, WithHTTPClient(specificHTTPClient))

type CloudEventHandler

type CloudEventHandler interface {
	OnFetch(obj interface{})
}

CloudEventHandler fetches state from the cloud and generates events that can be consumed by ResourceEventHandler

type ConfiguredUpstreams

type ConfiguredUpstreams struct {
	Data DataUpstreams `json:"data"`
}

type DataPayloadProxyGroup

type DataPayloadProxyGroup struct {
	Data   ProxyGroupConfig
	Errors []GraphErr
}

type DataPayloadSaarasApp2

type DataPayloadSaarasApp2 struct {
	Data   SaarasApp2
	Errors []GraphErr
}

type DataPayloadSecrets

type DataPayloadSecrets struct {
	Data   SaarasDbSecret
	Errors []GraphErr
}

type DataUpstreams

type DataUpstreams struct {
	SaarasUpstreams []cfg.SaarasUpstream `json:"saaras_db_upstream"`
}

type File

type File struct {
	Field string
	Name  string
	R     io.Reader
}

File represents a file to upload.

type Filter

type Filter struct {
	FilterID         int                       `json:"filter_id"`
	Filter_name      string                    `json:"filter_name"`
	Filter_type      string                    `json:"filter_type"`
	Filter_config    string                    `json:"filter_config"`
	Filter_upstreams []cfg.SaarasMicroService2 `json:"filter_upstreams"`
}

type GraphErr

type GraphErr struct {
	Message string
}

type ProxyGroupConfig

type ProxyGroupConfig struct {
	Saaras_db_proxygroup_config []cfg.SaarasProxyGroupConfig
}

type Request

type Request struct {

	// Header represent any request headers that will be set
	// when the request is made.
	Header http.Header
	// contains filtered or unexported fields
}

Request is a GraphQL request.

func NewRequest

func NewRequest(q string) *Request

NewRequest makes a new Request with the specified string.

func (*Request) File

func (req *Request) File(fieldname, filename string, r io.Reader)

File sets a file to upload. Files are only supported with a Client that was created with the UseMultipartForm option.

func (*Request) Files

func (req *Request) Files() []File

Files gets the files in this request.

func (*Request) Query

func (req *Request) Query() string

Query gets the query string of this request.

func (*Request) Var

func (req *Request) Var(key string, value interface{})

Var sets a variable.

func (*Request) Vars

func (req *Request) Vars() map[string]interface{}

Vars gets the variables for this Request.

type RouteFilters

type RouteFilters struct {
	Filter Filter `json:"filter"`
}

type SaarasApp2

type SaarasApp2 struct {
	Saaras_db_proxy_service []SaarasGatewayHostService
}

type SaarasArtifact

type SaarasArtifact struct {
	Artifact_id    int64
	Artifact_name  string
	Artifact_type  string
	Artifact_value string
}

type SaarasCloudCache

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

func (*SaarasCloudCache) OnFetch

type SaarasDbSecret

type SaarasDbSecret struct {
	Saaras_db_application_secret []Secret
}

type SaarasGatewayHost2

type SaarasGatewayHost2 struct {
	Service_id      int64            `json:"service_id"`
	Service_name    string           `json:"service_name"`
	Fqdn            string           `json:"fqdn"`
	Create_ts       string           `json:"create_ts"`
	Update_ts       string           `json:"update_ts"`
	Routes          []SaarasRoute2   `json:"routes"`
	Service_secrets []SaarasSecrets  `json:"service_secrets"`
	Service_filters []ServiceFilters `json:"service_filters"`
}

type SaarasGatewayHostService

type SaarasGatewayHostService struct {
	Service SaarasGatewayHost2 `json:"service"`
	Proxy   struct {
		ProxyGlobalconfigs []struct {
			Globalconfig struct {
				GlobalconfigType string `json:"globalconfig_type"`
				GlobalconfigName string `json:"globalconfig_name"`
				Config           string `json:"config"`
			} `json:"globalconfig"`
		} `json:"proxy_globalconfigs"`
	} `json:"proxy"`
}

type SaarasRoute2

type SaarasRoute2 struct {
	Route_name      string                    `json:"route_name"`
	Route_prefix    string                    `json:"route_prefix"`
	Route_config    string                    `json:"route_config"`
	Create_ts       string                    `json:"create_ts"`
	Update_ts       string                    `json:"update_ts"`
	Route_upstreams []cfg.SaarasMicroService2 `json:"route_upstreams"`
	Route_filters   []RouteFilters            `json:"route_filters"`
}

type SaarasSecret

type SaarasSecret struct {
	Secret_id   int64
	Secret_name string
	Secret_key  string
	Secret_cert string
	Secret_sni  string
	Artifacts   []SaarasArtifact
	Create_ts   string
	Update_ts   string
}

type SaarasSecrets

type SaarasSecrets struct {
	Secret SaarasSecret
}

type Secret

type Secret struct {
	SecretsBySecretId SecretsBySId
	Secret_id         string
}

type SecretArtifact

type SecretArtifact struct {
	Secret_artifact_id   string
	Secret_artifact_name string
	Type                 string
	Key                  string
	Value                string
}

////////////////////////// Secret //////////////////////////

type SecretsBySId

type SecretsBySId struct {
	Secret_id                   string
	Secret_name                 string
	Secret_artifactsBySecret_id []SecretArtifact
}

type Service

type Service struct {
	logrus.FieldLogger
}

func (*Service) Start

func (svc *Service) Start(stop <-chan struct{}) error

Start fulfills the g.Start contract. When stop is closed the http server will shutdown.

type ServiceFilters

type ServiceFilters struct {
	Filter Filter `json:"filter"`
}

Jump to

Keyboard shortcuts

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