state

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ApisixUpstream = "ApisixUpstream"
	WatchFromKind  = "watch"
)
View Source
const (
	RouteKind    = "route"
	ServiceKind  = "service"
	UpstreamKind = "upstream"
	Create       = "create"
	Update       = "update"
	Delete       = "delete"
)

Variables

View Source
var UpstreamQueue chan UpstreamQueueObj

Functions

func SolverSingleUpstream

func SolverSingleUpstream(u *v1.Upstream, rwg RouteWorkerGroup, wg *sync.WaitGroup, errorChan chan CRDStatus)

func SolverUpstream

func SolverUpstream(upstreams []*v1.Upstream, rwg RouteWorkerGroup, wg *sync.WaitGroup, errorChan chan CRDStatus)

upstream

func SyncSsl

func SyncSsl(ssl *v1.Ssl, method string) error

func WaitWorkerGroup

func WaitWorkerGroup(id string, resultChan chan CRDStatus) (string, error)

func WatchUpstream

func WatchUpstream()

Types

type ApisixCombination

type ApisixCombination struct {
	Routes    []*v1.Route
	Services  []*v1.Service
	Upstreams []*v1.Upstream
}

func (*ApisixCombination) Remove

func (s *ApisixCombination) Remove() error

func (*ApisixCombination) Solver

func (s *ApisixCombination) Solver() (string, error)

Solver

func (*ApisixCombination) SyncWithGroup

func (s *ApisixCombination) SyncWithGroup(ctx context.Context, id string, resultChan chan CRDStatus)

type CRDStatus

type CRDStatus struct {
	Id     string `json:"id"`
	Status string `json:"status"`
	Err    error  `json:"err"`
}

type Event

type Event struct {
	Kind string      // route/service/upstream
	Op   string      // create update delete
	Obj  interface{} // the obj of kind
}

type Quit

type Quit struct {
	Err error
}

type ResourceStatus

type ResourceStatus struct {
	Kind string `json:"kind"`
	Id   string `json:"id"`
	Err  error  `json:"err"`
}

type RouteCompare

type RouteCompare struct {
	OldRoutes []*v1.Route
	NewRoutes []*v1.Route
}

func (*RouteCompare) Sync

func (rc *RouteCompare) Sync() error

Sync remove from apisix

type RouteWorkerGroup

type RouteWorkerGroup map[string][]*routeWorker

RouteWorkerGroup for broadcast from service to route

func NewRouteWorkers

func NewRouteWorkers(ctx context.Context,
	routes []*v1.Route, wg *sync.WaitGroup, errorChan chan CRDStatus) RouteWorkerGroup

NewRouteWorkers make routeWorkers group by service per CRD 1.make routes group by (1_2_3) it may be a map like map[1_2_3][]Route; 2.route is listening Event from the ready of 1_2_3;

func (*RouteWorkerGroup) Add

func (rg *RouteWorkerGroup) Add(key string, rw *routeWorker)

func (*RouteWorkerGroup) Delete

func (rg *RouteWorkerGroup) Delete(key string, route *routeWorker)

type ServiceQueueObj

type ServiceQueueObj struct {
	Services         []*v1.Service
	RouteWorkerGroup RouteWorkerGroup
}

type UpstreamQueueObj

type UpstreamQueueObj struct {
	Upstreams        []*v1.Upstream
	RouteWorkerGroup RouteWorkerGroup
	Wg               *sync.WaitGroup
	ErrorChan        chan CRDStatus
}

UpstreamQueueObj for upstream queue

func (*UpstreamQueueObj) AddQueue

func (uqo *UpstreamQueueObj) AddQueue()

AddQueue make upstreams in order upstreams is group by CRD

Jump to

Keyboard shortcuts

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