api

package
v0.0.0-...-a063660 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2020 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitGRPC

func InitGRPC()

func RegisterApiServer

func RegisterApiServer(s *grpc.Server, srv ApiServer)

Types

type ApiClient

type ApiClient interface {
	GetUserByName(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error)
	GetUserByID(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error)
	Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
	GetServers(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetServerResponse, error)
	GetTavern(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetTavernResponse, error)
}

ApiClient is the client API for Api service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewApiClient

func NewApiClient(cc *grpc.ClientConn) ApiClient

type ApiServer

type ApiServer interface {
	GetUserByName(context.Context, *GetUserRequest) (*User, error)
	GetUserByID(context.Context, *GetUserRequest) (*User, error)
	Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
	GetServers(context.Context, *Empty) (*GetServerResponse, error)
	GetTavern(context.Context, *Empty) (*GetTavernResponse, error)
}

ApiServer is the server API for Api service.

type ApiService

type ApiService struct{}

func (*ApiService) GetServers

func (s *ApiService) GetServers(ctx context.Context, req *Empty) (*GetServerResponse, error)

func (*ApiService) GetTavern

func (s *ApiService) GetTavern(ctx context.Context, req *Empty) (*GetTavernResponse, error)

func (*ApiService) GetUserByID

func (s *ApiService) GetUserByID(ctx context.Context, req *GetUserRequest) (*User, error)

func (*ApiService) GetUserByName

func (s *ApiService) GetUserByName(ctx context.Context, req *GetUserRequest) (*User, error)

func (*ApiService) Register

func (s *ApiService) Register(ctx context.Context, req *RegisterRequest) (*RegisterResponse, error)

type Empty

type Empty struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Empty) Descriptor

func (*Empty) Descriptor() ([]byte, []int)

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Empty) XXX_Merge

func (m *Empty) XXX_Merge(src proto.Message)

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

func (m *Empty) XXX_Unmarshal(b []byte) error

type GetServerResponse

type GetServerResponse struct {
	Servers              []*Server `protobuf:"bytes,1,rep,name=servers,proto3" json:"servers,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*GetServerResponse) Descriptor

func (*GetServerResponse) Descriptor() ([]byte, []int)

func (*GetServerResponse) GetServers

func (m *GetServerResponse) GetServers() []*Server

func (*GetServerResponse) ProtoMessage

func (*GetServerResponse) ProtoMessage()

func (*GetServerResponse) Reset

func (m *GetServerResponse) Reset()

func (*GetServerResponse) String

func (m *GetServerResponse) String() string

func (*GetServerResponse) XXX_DiscardUnknown

func (m *GetServerResponse) XXX_DiscardUnknown()

func (*GetServerResponse) XXX_Marshal

func (m *GetServerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetServerResponse) XXX_Merge

func (m *GetServerResponse) XXX_Merge(src proto.Message)

func (*GetServerResponse) XXX_Size

func (m *GetServerResponse) XXX_Size() int

func (*GetServerResponse) XXX_Unmarshal

func (m *GetServerResponse) XXX_Unmarshal(b []byte) error

type GetTavernResponse

type GetTavernResponse struct {
	Items                []byte   `protobuf:"bytes,1,opt,name=items,proto3" json:"items,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetTavernResponse) Descriptor

func (*GetTavernResponse) Descriptor() ([]byte, []int)

func (*GetTavernResponse) GetItems

func (m *GetTavernResponse) GetItems() []byte

func (*GetTavernResponse) ProtoMessage

func (*GetTavernResponse) ProtoMessage()

func (*GetTavernResponse) Reset

func (m *GetTavernResponse) Reset()

func (*GetTavernResponse) String

func (m *GetTavernResponse) String() string

func (*GetTavernResponse) XXX_DiscardUnknown

func (m *GetTavernResponse) XXX_DiscardUnknown()

func (*GetTavernResponse) XXX_Marshal

func (m *GetTavernResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetTavernResponse) XXX_Merge

func (m *GetTavernResponse) XXX_Merge(src proto.Message)

func (*GetTavernResponse) XXX_Size

func (m *GetTavernResponse) XXX_Size() int

func (*GetTavernResponse) XXX_Unmarshal

func (m *GetTavernResponse) XXX_Unmarshal(b []byte) error

type GetUserRequest

type GetUserRequest struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Username             string   `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetUserRequest) Descriptor

func (*GetUserRequest) Descriptor() ([]byte, []int)

func (*GetUserRequest) GetId

func (m *GetUserRequest) GetId() string

func (*GetUserRequest) GetUsername

func (m *GetUserRequest) GetUsername() string

func (*GetUserRequest) ProtoMessage

func (*GetUserRequest) ProtoMessage()

func (*GetUserRequest) Reset

func (m *GetUserRequest) Reset()

func (*GetUserRequest) String

func (m *GetUserRequest) String() string

func (*GetUserRequest) XXX_DiscardUnknown

func (m *GetUserRequest) XXX_DiscardUnknown()

func (*GetUserRequest) XXX_Marshal

func (m *GetUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetUserRequest) XXX_Merge

func (m *GetUserRequest) XXX_Merge(src proto.Message)

func (*GetUserRequest) XXX_Size

func (m *GetUserRequest) XXX_Size() int

func (*GetUserRequest) XXX_Unmarshal

func (m *GetUserRequest) XXX_Unmarshal(b []byte) error

type RegisterRequest

type RegisterRequest struct {
	Username             string   `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Mail                 string   `protobuf:"bytes,2,opt,name=mail,proto3" json:"mail,omitempty"`
	Password             string   `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RegisterRequest) Descriptor

func (*RegisterRequest) Descriptor() ([]byte, []int)

func (*RegisterRequest) GetMail

func (m *RegisterRequest) GetMail() string

func (*RegisterRequest) GetPassword

func (m *RegisterRequest) GetPassword() string

func (*RegisterRequest) GetUsername

func (m *RegisterRequest) GetUsername() string

func (*RegisterRequest) ProtoMessage

func (*RegisterRequest) ProtoMessage()

func (*RegisterRequest) Reset

func (m *RegisterRequest) Reset()

func (*RegisterRequest) String

func (m *RegisterRequest) String() string

func (*RegisterRequest) XXX_DiscardUnknown

func (m *RegisterRequest) XXX_DiscardUnknown()

func (*RegisterRequest) XXX_Marshal

func (m *RegisterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RegisterRequest) XXX_Merge

func (m *RegisterRequest) XXX_Merge(src proto.Message)

func (*RegisterRequest) XXX_Size

func (m *RegisterRequest) XXX_Size() int

func (*RegisterRequest) XXX_Unmarshal

func (m *RegisterRequest) XXX_Unmarshal(b []byte) error

type RegisterResponse

type RegisterResponse struct {
	Ok                   bool     `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	UserID               string   `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RegisterResponse) Descriptor

func (*RegisterResponse) Descriptor() ([]byte, []int)

func (*RegisterResponse) GetOk

func (m *RegisterResponse) GetOk() bool

func (*RegisterResponse) GetUserID

func (m *RegisterResponse) GetUserID() string

func (*RegisterResponse) ProtoMessage

func (*RegisterResponse) ProtoMessage()

func (*RegisterResponse) Reset

func (m *RegisterResponse) Reset()

func (*RegisterResponse) String

func (m *RegisterResponse) String() string

func (*RegisterResponse) XXX_DiscardUnknown

func (m *RegisterResponse) XXX_DiscardUnknown()

func (*RegisterResponse) XXX_Marshal

func (m *RegisterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RegisterResponse) XXX_Merge

func (m *RegisterResponse) XXX_Merge(src proto.Message)

func (*RegisterResponse) XXX_Size

func (m *RegisterResponse) XXX_Size() int

func (*RegisterResponse) XXX_Unmarshal

func (m *RegisterResponse) XXX_Unmarshal(b []byte) error

type Server

type Server struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Totalplayers         int32    `protobuf:"varint,2,opt,name=totalplayers,proto3" json:"totalplayers,omitempty"`
	Maxplayers           int32    `protobuf:"varint,3,opt,name=maxplayers,proto3" json:"maxplayers,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Server) Descriptor

func (*Server) Descriptor() ([]byte, []int)

func (*Server) GetMaxplayers

func (m *Server) GetMaxplayers() int32

func (*Server) GetName

func (m *Server) GetName() string

func (*Server) GetTotalplayers

func (m *Server) GetTotalplayers() int32

func (*Server) ProtoMessage

func (*Server) ProtoMessage()

func (*Server) Reset

func (m *Server) Reset()

func (*Server) String

func (m *Server) String() string

func (*Server) XXX_DiscardUnknown

func (m *Server) XXX_DiscardUnknown()

func (*Server) XXX_Marshal

func (m *Server) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Server) XXX_Merge

func (m *Server) XXX_Merge(src proto.Message)

func (*Server) XXX_Size

func (m *Server) XXX_Size() int

func (*Server) XXX_Unmarshal

func (m *Server) XXX_Unmarshal(b []byte) error

type User

type User struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Username             string   `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	Password             string   `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
	Usertype             int32    `protobuf:"varint,4,opt,name=usertype,proto3" json:"usertype,omitempty"`
	Ip                   string   `protobuf:"bytes,5,opt,name=ip,proto3" json:"ip,omitempty"`
	Server               int32    `protobuf:"varint,6,opt,name=server,proto3" json:"server,omitempty"`
	Cash                 int64    `protobuf:"varint,7,opt,name=cash,proto3" json:"cash,omitempty"`
	Mail                 string   `protobuf:"bytes,8,opt,name=mail,proto3" json:"mail,omitempty"`
	CreatedAt            string   `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	DisabledAt           string   `protobuf:"bytes,10,opt,name=disabled_at,json=disabledAt,proto3" json:"disabled_at,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*User) Descriptor

func (*User) Descriptor() ([]byte, []int)

func (*User) GetCash

func (m *User) GetCash() int64

func (*User) GetCreatedAt

func (m *User) GetCreatedAt() string

func (*User) GetDisabledAt

func (m *User) GetDisabledAt() string

func (*User) GetId

func (m *User) GetId() string

func (*User) GetIp

func (m *User) GetIp() string

func (*User) GetMail

func (m *User) GetMail() string

func (*User) GetPassword

func (m *User) GetPassword() string

func (*User) GetServer

func (m *User) GetServer() int32

func (*User) GetUsername

func (m *User) GetUsername() string

func (*User) GetUsertype

func (m *User) GetUsertype() int32

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) String

func (m *User) String() string

func (*User) XXX_DiscardUnknown

func (m *User) XXX_DiscardUnknown()

func (*User) XXX_Marshal

func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*User) XXX_Merge

func (m *User) XXX_Merge(src proto.Message)

func (*User) XXX_Size

func (m *User) XXX_Size() int

func (*User) XXX_Unmarshal

func (m *User) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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