worker

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Copyright © 2020 Marvin

Licensed 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 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	FlagSet       *flag.FlagSet             `json:"-"`
	ConfigFile    string                    `toml:"config-file" json:"config-file"`
	WorkerOptions *configutil.WorkerOptions `toml:"worker" json:"worker"`
	LogConfig     *logger.Config            `toml:"log" json:"log"`

	PrintVersion bool `json:"-"`
}

Config is the configuration for dbms-master

func NewConfig

func NewConfig() *Config

func (*Config) Parse

func (c *Config) Parse(args []string) error

func (*Config) String

func (c *Config) String() string

type Server

type Server struct {
	*Config

	// UnimplementedWorkerServer
	pb.UnimplementedWorkerServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cfg *Config) *Server

NewServer creates a new server

func (*Server) Close

func (s *Server) Close()

Close the server, this function can be called multiple times.

func (*Server) OperateDelete added in v0.0.8

func (s *Server) OperateDelete(ctx context.Context, t *task.Task) error

func (*Server) OperateStart added in v0.0.8

func (s *Server) OperateStart(ctx context.Context, t *task.Task)

func (*Server) OperateStop added in v0.0.8

func (s *Server) OperateStop(ctx context.Context, t *task.Task) error

func (*Server) OperateWorker

func (s *Server) OperateWorker(ctx context.Context, req *pb.OperateWorkerRequest) (*pb.OperateWorkerResponse, error)

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start starts to serving

Jump to

Keyboard shortcuts

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