protos

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	State_name = map[int32]string{
		0: "ACTIVE",
		1: "DELETED",
	}
	State_value = map[string]int32{
		"ACTIVE":  0,
		"DELETED": 1,
	}
)

Enum value maps for State.

View Source
var File_protos_openwrt_proto protoreflect.FileDescriptor
View Source
var OpenWRT_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "protos.OpenWRT",
	HandlerType: (*OpenWRTServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetToken",
			Handler:    _OpenWRT_GetToken_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "EventStream",
			Handler:       _OpenWRT_EventStream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "protos/openwrt.proto",
}

OpenWRT_ServiceDesc is the grpc.ServiceDesc for OpenWRT service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterOpenWRTServer

func RegisterOpenWRTServer(s grpc.ServiceRegistrar, srv OpenWRTServer)

Types

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

func (x *Empty) ProtoReflect() protoreflect.Message

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type Event

type Event struct {
	EventId     string       `protobuf:"bytes,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"`
	Network     *Network     `protobuf:"bytes,2,opt,name=network,proto3" json:"network,omitempty"`
	Host        *Host        `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"`
	PublicIp    *PublicIP    `protobuf:"bytes,4,opt,name=public_ip,json=publicIp,proto3" json:"public_ip,omitempty"`
	PortForward *PortForward `protobuf:"bytes,5,opt,name=port_forward,json=portForward,proto3" json:"port_forward,omitempty"`
	// contains filtered or unexported fields
}

func (*Event) Descriptor deprecated

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

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetEventId

func (x *Event) GetEventId() string

func (*Event) GetHost

func (x *Event) GetHost() *Host

func (*Event) GetNetwork

func (x *Event) GetNetwork() *Network

func (*Event) GetPortForward

func (x *Event) GetPortForward() *PortForward

func (*Event) GetPublicIp

func (x *Event) GetPublicIp() *PublicIP

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

func (x *Event) ProtoReflect() protoreflect.Message

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

type Host

type Host struct {
	NetworkId string `protobuf:"bytes,1,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"`
	State     State  `protobuf:"varint,2,opt,name=state,proto3,enum=protos.State" json:"state,omitempty"`
	Mac       string `protobuf:"bytes,3,opt,name=mac,proto3" json:"mac,omitempty"`
	Ip        string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"`
	Instance  string `protobuf:"bytes,5,opt,name=instance,proto3" json:"instance,omitempty"`
	UserData  []byte `protobuf:"bytes,6,opt,name=user_data,json=userData,proto3" json:"user_data,omitempty"`
	// contains filtered or unexported fields
}

func (*Host) Descriptor deprecated

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

Deprecated: Use Host.ProtoReflect.Descriptor instead.

func (*Host) GetInstance

func (x *Host) GetInstance() string

func (*Host) GetIp

func (x *Host) GetIp() string

func (*Host) GetMac

func (x *Host) GetMac() string

func (*Host) GetNetworkId

func (x *Host) GetNetworkId() string

func (*Host) GetState

func (x *Host) GetState() State

func (*Host) GetUserData

func (x *Host) GetUserData() []byte

func (*Host) ProtoMessage

func (*Host) ProtoMessage()

func (*Host) ProtoReflect

func (x *Host) ProtoReflect() protoreflect.Message

func (*Host) Reset

func (x *Host) Reset()

func (*Host) String

func (x *Host) String() string

type Instance

type Instance struct {
	Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"`
	// contains filtered or unexported fields
}

func (*Instance) Descriptor deprecated

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

Deprecated: Use Instance.ProtoReflect.Descriptor instead.

func (*Instance) GetHostname

func (x *Instance) GetHostname() string

func (*Instance) ProtoMessage

func (*Instance) ProtoMessage()

func (*Instance) ProtoReflect

func (x *Instance) ProtoReflect() protoreflect.Message

func (*Instance) Reset

func (x *Instance) Reset()

func (*Instance) String

func (x *Instance) String() string

type Network

type Network struct {
	ResourceId string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"`
	State      State  `protobuf:"varint,2,opt,name=state,proto3,enum=protos.State" json:"state,omitempty"`
	VlanId     int32  `protobuf:"varint,3,opt,name=vlan_id,json=vlanId,proto3" json:"vlan_id,omitempty"`
	Subnet     string `protobuf:"bytes,4,opt,name=subnet,proto3" json:"subnet,omitempty"`
	// contains filtered or unexported fields
}

func (*Network) Descriptor deprecated

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

Deprecated: Use Network.ProtoReflect.Descriptor instead.

func (*Network) GetResourceId

func (x *Network) GetResourceId() string

func (*Network) GetState

func (x *Network) GetState() State

func (*Network) GetSubnet

func (x *Network) GetSubnet() string

func (*Network) GetVlanId

func (x *Network) GetVlanId() int32

func (*Network) ProtoMessage

func (*Network) ProtoMessage()

func (*Network) ProtoReflect

func (x *Network) ProtoReflect() protoreflect.Message

func (*Network) Reset

func (x *Network) Reset()

func (*Network) String

func (x *Network) String() string

type OpenWRTClient

type OpenWRTClient interface {
	EventStream(ctx context.Context, in *Empty, opts ...grpc.CallOption) (OpenWRT_EventStreamClient, error)
	GetToken(ctx context.Context, in *Instance, opts ...grpc.CallOption) (*Token, error)
}

OpenWRTClient is the client API for OpenWRT service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewOpenWRTClient

func NewOpenWRTClient(cc grpc.ClientConnInterface) OpenWRTClient

type OpenWRTServer

type OpenWRTServer interface {
	EventStream(*Empty, OpenWRT_EventStreamServer) error
	GetToken(context.Context, *Instance) (*Token, error)
	// contains filtered or unexported methods
}

OpenWRTServer is the server API for OpenWRT service. All implementations must embed UnimplementedOpenWRTServer for forward compatibility

type OpenWRT_EventStreamClient

type OpenWRT_EventStreamClient interface {
	Recv() (*Event, error)
	grpc.ClientStream
}

type OpenWRT_EventStreamServer

type OpenWRT_EventStreamServer interface {
	Send(*Event) error
	grpc.ServerStream
}

type PortForward

type PortForward struct {
	Id              string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	PublicIP        string `protobuf:"bytes,2,opt,name=publicIP,proto3" json:"publicIP,omitempty"`
	PublicNetwork   string `protobuf:"bytes,3,opt,name=publicNetwork,proto3" json:"publicNetwork,omitempty"`
	PublicPort      int32  `protobuf:"varint,4,opt,name=publicPort,proto3" json:"publicPort,omitempty"`
	InternalNetwork string `protobuf:"bytes,5,opt,name=internalNetwork,proto3" json:"internalNetwork,omitempty"`
	InternalHost    string `protobuf:"bytes,6,opt,name=internalHost,proto3" json:"internalHost,omitempty"`
	InternalPort    int32  `protobuf:"varint,7,opt,name=internalPort,proto3" json:"internalPort,omitempty"`
	// contains filtered or unexported fields
}

func (*PortForward) Descriptor deprecated

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

Deprecated: Use PortForward.ProtoReflect.Descriptor instead.

func (*PortForward) GetId

func (x *PortForward) GetId() string

func (*PortForward) GetInternalHost

func (x *PortForward) GetInternalHost() string

func (*PortForward) GetInternalNetwork

func (x *PortForward) GetInternalNetwork() string

func (*PortForward) GetInternalPort

func (x *PortForward) GetInternalPort() int32

func (*PortForward) GetPublicIP

func (x *PortForward) GetPublicIP() string

func (*PortForward) GetPublicNetwork

func (x *PortForward) GetPublicNetwork() string

func (*PortForward) GetPublicPort

func (x *PortForward) GetPublicPort() int32

func (*PortForward) ProtoMessage

func (*PortForward) ProtoMessage()

func (*PortForward) ProtoReflect

func (x *PortForward) ProtoReflect() protoreflect.Message

func (*PortForward) Reset

func (x *PortForward) Reset()

func (*PortForward) String

func (x *PortForward) String() string

type PublicIP

type PublicIP struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	Netmask string `protobuf:"bytes,3,opt,name=netmask,proto3" json:"netmask,omitempty"`
	// contains filtered or unexported fields
}

func (*PublicIP) Descriptor deprecated

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

Deprecated: Use PublicIP.ProtoReflect.Descriptor instead.

func (*PublicIP) GetAddress

func (x *PublicIP) GetAddress() string

func (*PublicIP) GetId

func (x *PublicIP) GetId() string

func (*PublicIP) GetNetmask

func (x *PublicIP) GetNetmask() string

func (*PublicIP) ProtoMessage

func (*PublicIP) ProtoMessage()

func (*PublicIP) ProtoReflect

func (x *PublicIP) ProtoReflect() protoreflect.Message

func (*PublicIP) Reset

func (x *PublicIP) Reset()

func (*PublicIP) String

func (x *PublicIP) String() string

type State

type State int32
const (
	State_ACTIVE  State = 0
	State_DELETED State = 1
)

func (State) Descriptor

func (State) Descriptor() protoreflect.EnumDescriptor

func (State) Enum

func (x State) Enum() *State

func (State) EnumDescriptor deprecated

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

Deprecated: Use State.Descriptor instead.

func (State) Number

func (x State) Number() protoreflect.EnumNumber

func (State) String

func (x State) String() string

func (State) Type

func (State) Type() protoreflect.EnumType

type Token

type Token struct {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*Token) Descriptor deprecated

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

Deprecated: Use Token.ProtoReflect.Descriptor instead.

func (*Token) GetToken

func (x *Token) GetToken() string

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) ProtoReflect

func (x *Token) ProtoReflect() protoreflect.Message

func (*Token) Reset

func (x *Token) Reset()

func (*Token) String

func (x *Token) String() string

type UnimplementedOpenWRTServer

type UnimplementedOpenWRTServer struct {
}

UnimplementedOpenWRTServer must be embedded to have forward compatible implementations.

func (UnimplementedOpenWRTServer) EventStream

func (UnimplementedOpenWRTServer) GetToken

type UnsafeOpenWRTServer

type UnsafeOpenWRTServer interface {
	// contains filtered or unexported methods
}

UnsafeOpenWRTServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OpenWRTServer will result in compilation errors.

Jump to

Keyboard shortcuts

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