server

package
v0.0.0-...-b7a815f Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenDefaultCfg

func GenDefaultCfg(path string) error

Types

type Config

type Config struct {
	Etcd struct {
		DialTimeout time.Duration `yaml:"dial_timeout"`
		Endpoints   []string      `yaml:"endpoints"`
	}
}

func ReadCfg

func ReadCfg(path string) (*Config, error)

type NamingServiceServer

type NamingServiceServer struct {
	pb.UnimplementedNameServiceServer
	DialTimeout time.Duration
	Endpoints   []string
}

func NewNamingService

func NewNamingService(cfg *Config) *NamingServiceServer

func (NamingServiceServer) CreateGroup

func (s NamingServiceServer) CreateGroup(ctx context.Context, newGroup *pb.NewGroup) (*pb.Group, error)

func (NamingServiceServer) CreateUser

func (s NamingServiceServer) CreateUser(ctx context.Context, newUser *pb.NewUser) (*pb.User, error)

func (NamingServiceServer) GetAddress

func (s NamingServiceServer) GetAddress(ctx context.Context, userID *pb.UserId) (*pb.User, error)

func (NamingServiceServer) GetGroupAddresses

func (s NamingServiceServer) GetGroupAddresses(group *pb.Group, stream pb.NameService_GetGroupAddressesServer) error

func (NamingServiceServer) JoinGroup

func (s NamingServiceServer) JoinGroup(ctx context.Context, group *pb.JoinRequest) (*pb.Group, error)

Jump to

Keyboard shortcuts

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