adminapi

package
v0.0.0-...-7523913 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2019 License: MIT Imports: 6 Imported by: 0

README

Admin api

To generate the admin api stubs run the following command from the root directory docker run --rm -v $(pwd):$(pwd) -w $(pwd) znly/protoc -I . -I vendor pkg/adminapi/adminapi.proto --go_out=plugins=grpc:.

WARNING: make sure you have first initialized the project by running govendor sync since the admin api protobuf file has a dependency.

NOTE: govendor sometimes doesn't want to update the abuse-mesh-protocol dependency because it contains no go code. If this happens the solution is to clear the govendor cache and then retrying to fetch the new version.

Documentation

Overview

Package adminapi is a generated protocol buffer package.

It is generated from these files:

internal/adminapi/adminapi.proto

It has these top-level messages:

GetNodeRequest
GetClientsRequest
GetServersRequest
GetClientsResponse
GetServersResponse
Client
Server

Index

Constants

This section is empty.

Variables

View Source
var ClientSessionState_name = map[int32]string{
	0: "ClientSessionIdle",
	1: "ClientSessionEstablished",
	2: "ClientSessionInterrupted",
}
View Source
var ClientSessionState_value = map[string]int32{
	"ClientSessionIdle":        0,
	"ClientSessionEstablished": 1,
	"ClientSessionInterrupted": 2,
}
View Source
var ServerSessionState_name = map[int32]string{
	0: "ServerSessionIdle",
	1: "ServerSessionEstablished",
	2: "ServerSessionConnecting",
	3: "ServerSessionInterrupted",
}
View Source
var ServerSessionState_value = map[string]int32{
	"ServerSessionIdle":        0,
	"ServerSessionEstablished": 1,
	"ServerSessionConnecting":  2,
	"ServerSessionInterrupted": 3,
}

Functions

func RegisterAdmininterfaceServer

func RegisterAdmininterfaceServer(s *grpc.Server, srv AdmininterfaceServer)

Types

type AdmininterfaceClient

type AdmininterfaceClient interface {
	// Returns the Node data of the current node
	GetNode(ctx context.Context, in *GetNodeRequest, opts ...grpc.CallOption) (*abusemesh.Node, error)
	// Returns all clients of this node
	GetClients(ctx context.Context, in *GetClientsRequest, opts ...grpc.CallOption) (*GetClientsResponse, error)
	// Returns all servers of this node
	GetServers(ctx context.Context, in *GetServersRequest, opts ...grpc.CallOption) (*GetServersResponse, error)
}

func NewAdmininterfaceClient

func NewAdmininterfaceClient(cc *grpc.ClientConn) AdmininterfaceClient

type AdmininterfaceServer

type AdmininterfaceServer interface {
	// Returns the Node data of the current node
	GetNode(context.Context, *GetNodeRequest) (*abusemesh.Node, error)
	// Returns all clients of this node
	GetClients(context.Context, *GetClientsRequest) (*GetClientsResponse, error)
	// Returns all servers of this node
	GetServers(context.Context, *GetServersRequest) (*GetServersResponse, error)
}

type Client

type Client struct {
	// The id of the client node
	NodeId *abusemesh.UUID `protobuf:"bytes,1,opt,name=node_id,json=nodeId" json:"node_id,omitempty"`
	// The id of this session
	SessionId *abusemesh.UUID `protobuf:"bytes,2,opt,name=session_id,json=sessionId" json:"session_id,omitempty"`
	// If true the server wants to connect with the client
	// If false no session will be accepted
	ServerActive bool `protobuf:"varint,3,opt,name=server_active,json=serverActive" json:"server_active,omitempty"`
	// The current state of the connection
	State ClientSessionState `protobuf:"varint,4,opt,name=state,enum=adminapi.ClientSessionState" json:"state,omitempty"`
	// The count of events sent to the client
	EventCount uint64 `protobuf:"varint,5,opt,name=event_count,json=eventCount" json:"event_count,omitempty"`
}

func (*Client) Descriptor

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

func (*Client) GetEventCount

func (m *Client) GetEventCount() uint64

func (*Client) GetNodeId

func (m *Client) GetNodeId() *abusemesh.UUID

func (*Client) GetServerActive

func (m *Client) GetServerActive() bool

func (*Client) GetSessionId

func (m *Client) GetSessionId() *abusemesh.UUID

func (*Client) GetState

func (m *Client) GetState() ClientSessionState

func (*Client) ProtoMessage

func (*Client) ProtoMessage()

func (*Client) Reset

func (m *Client) Reset()

func (*Client) String

func (m *Client) String() string

type ClientSessionState

type ClientSessionState int32

The state the server assigned to the session with a client

const (
	ClientSessionState_ClientSessionIdle        ClientSessionState = 0
	ClientSessionState_ClientSessionEstablished ClientSessionState = 1
	ClientSessionState_ClientSessionInterrupted ClientSessionState = 2
)

func (ClientSessionState) EnumDescriptor

func (ClientSessionState) EnumDescriptor() ([]byte, []int)

func (ClientSessionState) String

func (x ClientSessionState) String() string

type GetClientsRequest

type GetClientsRequest struct {
}

func (*GetClientsRequest) Descriptor

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

func (*GetClientsRequest) ProtoMessage

func (*GetClientsRequest) ProtoMessage()

func (*GetClientsRequest) Reset

func (m *GetClientsRequest) Reset()

func (*GetClientsRequest) String

func (m *GetClientsRequest) String() string

type GetClientsResponse

type GetClientsResponse struct {
	Client []*Client `protobuf:"bytes,1,rep,name=client" json:"client,omitempty"`
}

func (*GetClientsResponse) Descriptor

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

func (*GetClientsResponse) GetClient

func (m *GetClientsResponse) GetClient() []*Client

func (*GetClientsResponse) ProtoMessage

func (*GetClientsResponse) ProtoMessage()

func (*GetClientsResponse) Reset

func (m *GetClientsResponse) Reset()

func (*GetClientsResponse) String

func (m *GetClientsResponse) String() string

type GetNodeRequest

type GetNodeRequest struct {
}

func (*GetNodeRequest) Descriptor

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

func (*GetNodeRequest) ProtoMessage

func (*GetNodeRequest) ProtoMessage()

func (*GetNodeRequest) Reset

func (m *GetNodeRequest) Reset()

func (*GetNodeRequest) String

func (m *GetNodeRequest) String() string

type GetServersRequest

type GetServersRequest struct {
}

func (*GetServersRequest) Descriptor

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

func (*GetServersRequest) ProtoMessage

func (*GetServersRequest) ProtoMessage()

func (*GetServersRequest) Reset

func (m *GetServersRequest) Reset()

func (*GetServersRequest) String

func (m *GetServersRequest) String() string

type GetServersResponse

type GetServersResponse struct {
	Client []*Client `protobuf:"bytes,1,rep,name=client" json:"client,omitempty"`
}

func (*GetServersResponse) Descriptor

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

func (*GetServersResponse) GetClient

func (m *GetServersResponse) GetClient() []*Client

func (*GetServersResponse) ProtoMessage

func (*GetServersResponse) ProtoMessage()

func (*GetServersResponse) Reset

func (m *GetServersResponse) Reset()

func (*GetServersResponse) String

func (m *GetServersResponse) String() string

type Server

type Server struct {
	// The id of the server node
	NodeId *abusemesh.UUID `protobuf:"bytes,1,opt,name=node_id,json=nodeId" json:"node_id,omitempty"`
	// The id of this session
	SessionId *abusemesh.UUID `protobuf:"bytes,2,opt,name=session_id,json=sessionId" json:"session_id,omitempty"`
	// If true the we are trying to connect to the server
	// If false no connection attempts will be made
	ClientActive bool `protobuf:"varint,3,opt,name=client_active,json=clientActive" json:"client_active,omitempty"`
	// The current state of the connection
	State ServerSessionState `protobuf:"varint,4,opt,name=state,enum=adminapi.ServerSessionState" json:"state,omitempty"`
	// The count of events received by the server
	EventCount uint64 `protobuf:"varint,5,opt,name=event_count,json=eventCount" json:"event_count,omitempty"`
}

func (*Server) Descriptor

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

func (*Server) GetClientActive

func (m *Server) GetClientActive() bool

func (*Server) GetEventCount

func (m *Server) GetEventCount() uint64

func (*Server) GetNodeId

func (m *Server) GetNodeId() *abusemesh.UUID

func (*Server) GetSessionId

func (m *Server) GetSessionId() *abusemesh.UUID

func (*Server) GetState

func (m *Server) GetState() ServerSessionState

func (*Server) ProtoMessage

func (*Server) ProtoMessage()

func (*Server) Reset

func (m *Server) Reset()

func (*Server) String

func (m *Server) String() string

type ServerSessionState

type ServerSessionState int32

The state the server assigned to the session with a client

const (
	ServerSessionState_ServerSessionIdle        ServerSessionState = 0
	ServerSessionState_ServerSessionEstablished ServerSessionState = 1
	ServerSessionState_ServerSessionConnecting  ServerSessionState = 2
	ServerSessionState_ServerSessionInterrupted ServerSessionState = 3
)

func (ServerSessionState) EnumDescriptor

func (ServerSessionState) EnumDescriptor() ([]byte, []int)

func (ServerSessionState) String

func (x ServerSessionState) String() string

Jump to

Keyboard shortcuts

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