sigmarv1

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package sigmarv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	WeaponType_name = map[int32]string{
		0: "WEAPON_TYPE_NONE",
		1: "WEAPON_TYPE_MELEE",
		2: "WEAPON_TYPE_RANGED",
	}
	WeaponType_value = map[string]int32{
		"WEAPON_TYPE_NONE":   0,
		"WEAPON_TYPE_MELEE":  1,
		"WEAPON_TYPE_RANGED": 2,
	}
)

Enum value maps for WeaponType.

View Source
var File_brittonhayes_warhammer_sigmar_v1_sigmar_proto protoreflect.FileDescriptor
View Source
var SigmarService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "brittonhayes.warhammer.sigmar.v1.SigmarService",
	HandlerType: (*SigmarServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateUnit",
			Handler:    _SigmarService_CreateUnit_Handler,
		},
		{
			MethodName: "GetUnit",
			Handler:    _SigmarService_GetUnit_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "brittonhayes/warhammer/sigmar/v1/sigmar.proto",
}

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

Functions

func RegisterSigmarServiceHandler

func RegisterSigmarServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterSigmarServiceHandler registers the http handlers for service SigmarService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterSigmarServiceHandlerClient

func RegisterSigmarServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SigmarServiceClient) error

RegisterSigmarServiceHandlerClient registers the http handlers for service SigmarService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SigmarServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SigmarServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SigmarServiceClient" to call the correct interceptors.

func RegisterSigmarServiceHandlerFromEndpoint

func RegisterSigmarServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterSigmarServiceHandlerFromEndpoint is same as RegisterSigmarServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterSigmarServiceHandlerServer

func RegisterSigmarServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SigmarServiceServer) error

RegisterSigmarServiceHandlerServer registers the http handlers for service SigmarService to "mux". UnaryRPC :call SigmarServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSigmarServiceHandlerFromEndpoint instead.

func RegisterSigmarServiceServer

func RegisterSigmarServiceServer(s grpc.ServiceRegistrar, srv SigmarServiceServer)

Types

type Army

type Army struct {
	Army  string  `protobuf:"bytes,1,opt,name=army,proto3" json:"army,omitempty"`
	Units []*Unit `protobuf:"bytes,2,rep,name=units,proto3" json:"units,omitempty"`
	// contains filtered or unexported fields
}

func (*Army) Descriptor deprecated

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

Deprecated: Use Army.ProtoReflect.Descriptor instead.

func (*Army) GetArmy

func (x *Army) GetArmy() string

func (*Army) GetUnits

func (x *Army) GetUnits() []*Unit

func (*Army) ProtoMessage

func (*Army) ProtoMessage()

func (*Army) ProtoReflect

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

func (*Army) Reset

func (x *Army) Reset()

func (*Army) String

func (x *Army) String() string

type CreateUnitRequest

type CreateUnitRequest struct {
	Unit *Unit `protobuf:"bytes,1,opt,name=unit,proto3" json:"unit,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateUnitRequest) Descriptor deprecated

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

Deprecated: Use CreateUnitRequest.ProtoReflect.Descriptor instead.

func (*CreateUnitRequest) GetUnit

func (x *CreateUnitRequest) GetUnit() *Unit

func (*CreateUnitRequest) ProtoMessage

func (*CreateUnitRequest) ProtoMessage()

func (*CreateUnitRequest) ProtoReflect

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

func (*CreateUnitRequest) Reset

func (x *CreateUnitRequest) Reset()

func (*CreateUnitRequest) String

func (x *CreateUnitRequest) String() string

type CreateUnitResponse

type CreateUnitResponse struct {
	Status  int32  `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateUnitResponse) Descriptor deprecated

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

Deprecated: Use CreateUnitResponse.ProtoReflect.Descriptor instead.

func (*CreateUnitResponse) GetMessage

func (x *CreateUnitResponse) GetMessage() string

func (*CreateUnitResponse) GetStatus

func (x *CreateUnitResponse) GetStatus() int32

func (*CreateUnitResponse) ProtoMessage

func (*CreateUnitResponse) ProtoMessage()

func (*CreateUnitResponse) ProtoReflect

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

func (*CreateUnitResponse) Reset

func (x *CreateUnitResponse) Reset()

func (*CreateUnitResponse) String

func (x *CreateUnitResponse) String() string

type GetUnitRequest

type GetUnitRequest struct {
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUnitRequest) Descriptor deprecated

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

Deprecated: Use GetUnitRequest.ProtoReflect.Descriptor instead.

func (*GetUnitRequest) GetId

func (x *GetUnitRequest) GetId() int64

func (*GetUnitRequest) ProtoMessage

func (*GetUnitRequest) ProtoMessage()

func (*GetUnitRequest) ProtoReflect

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

func (*GetUnitRequest) Reset

func (x *GetUnitRequest) Reset()

func (*GetUnitRequest) String

func (x *GetUnitRequest) String() string

type GetUnitResponse

type GetUnitResponse struct {
	Data *Unit `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUnitResponse) Descriptor deprecated

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

Deprecated: Use GetUnitResponse.ProtoReflect.Descriptor instead.

func (*GetUnitResponse) GetData

func (x *GetUnitResponse) GetData() *Unit

func (*GetUnitResponse) ProtoMessage

func (*GetUnitResponse) ProtoMessage()

func (*GetUnitResponse) ProtoReflect

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

func (*GetUnitResponse) Reset

func (x *GetUnitResponse) Reset()

func (*GetUnitResponse) String

func (x *GetUnitResponse) String() string

type SigmarServiceClient

type SigmarServiceClient interface {
	CreateUnit(ctx context.Context, in *CreateUnitRequest, opts ...grpc.CallOption) (*CreateUnitResponse, error)
	GetUnit(ctx context.Context, in *GetUnitRequest, opts ...grpc.CallOption) (*GetUnitResponse, error)
}

SigmarServiceClient is the client API for SigmarService 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.

type SigmarServiceServer

type SigmarServiceServer interface {
	CreateUnit(context.Context, *CreateUnitRequest) (*CreateUnitResponse, error)
	GetUnit(context.Context, *GetUnitRequest) (*GetUnitResponse, error)
}

SigmarServiceServer is the server API for SigmarService service. All implementations should embed UnimplementedSigmarServiceServer for forward compatibility

type UnimplementedSigmarServiceServer

type UnimplementedSigmarServiceServer struct {
}

UnimplementedSigmarServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedSigmarServiceServer) CreateUnit

func (UnimplementedSigmarServiceServer) GetUnit

type Unit

type Unit struct {
	Id          string          `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name        string          `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Size        string          `protobuf:"bytes,3,opt,name=size,proto3" json:"size,omitempty"`
	Move        string          `protobuf:"bytes,4,opt,name=move,proto3" json:"move,omitempty"`
	Save        string          `protobuf:"bytes,5,opt,name=save,proto3" json:"save,omitempty"`
	Bravery     string          `protobuf:"bytes,6,opt,name=bravery,proto3" json:"bravery,omitempty"`
	Wounds      string          `protobuf:"bytes,7,opt,name=wounds,proto3" json:"wounds,omitempty"`
	Abilities   []*Unit_Ability `protobuf:"bytes,8,rep,name=abilities,proto3" json:"abilities,omitempty"`
	DamageTable []*Unit_Damage  `protobuf:"bytes,9,rep,name=damage_table,json=damageTable,proto3" json:"damage_table,omitempty"`
	Keywords    []string        `protobuf:"bytes,10,rep,name=keywords,proto3" json:"keywords,omitempty"`
	Weapons     []*Weapon       `protobuf:"bytes,11,rep,name=weapons,proto3" json:"weapons,omitempty"`
	// contains filtered or unexported fields
}

func (*Unit) Descriptor deprecated

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

Deprecated: Use Unit.ProtoReflect.Descriptor instead.

func (*Unit) GetAbilities

func (x *Unit) GetAbilities() []*Unit_Ability

func (*Unit) GetBravery

func (x *Unit) GetBravery() string

func (*Unit) GetDamageTable

func (x *Unit) GetDamageTable() []*Unit_Damage

func (*Unit) GetId

func (x *Unit) GetId() string

func (*Unit) GetKeywords

func (x *Unit) GetKeywords() []string

func (*Unit) GetMove

func (x *Unit) GetMove() string

func (*Unit) GetName

func (x *Unit) GetName() string

func (*Unit) GetSave

func (x *Unit) GetSave() string

func (*Unit) GetSize

func (x *Unit) GetSize() string

func (*Unit) GetWeapons

func (x *Unit) GetWeapons() []*Weapon

func (*Unit) GetWounds

func (x *Unit) GetWounds() string

func (*Unit) ProtoMessage

func (*Unit) ProtoMessage()

func (*Unit) ProtoReflect

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

func (*Unit) Reset

func (x *Unit) Reset()

func (*Unit) String

func (x *Unit) String() string

type Unit_Ability

type Unit_Ability struct {
	Name        string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

func (*Unit_Ability) Descriptor deprecated

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

Deprecated: Use Unit_Ability.ProtoReflect.Descriptor instead.

func (*Unit_Ability) GetDescription

func (x *Unit_Ability) GetDescription() string

func (*Unit_Ability) GetName

func (x *Unit_Ability) GetName() string

func (*Unit_Ability) ProtoMessage

func (*Unit_Ability) ProtoMessage()

func (*Unit_Ability) ProtoReflect

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

func (*Unit_Ability) Reset

func (x *Unit_Ability) Reset()

func (*Unit_Ability) String

func (x *Unit_Ability) String() string

type Unit_Damage

type Unit_Damage struct {
	Entry map[string]string `` /* 151-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Unit_Damage) Descriptor deprecated

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

Deprecated: Use Unit_Damage.ProtoReflect.Descriptor instead.

func (*Unit_Damage) GetEntry

func (x *Unit_Damage) GetEntry() map[string]string

func (*Unit_Damage) ProtoMessage

func (*Unit_Damage) ProtoMessage()

func (*Unit_Damage) ProtoReflect

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

func (*Unit_Damage) Reset

func (x *Unit_Damage) Reset()

func (*Unit_Damage) String

func (x *Unit_Damage) String() string

type UnsafeSigmarServiceServer

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

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

type Weapon

type Weapon struct {
	Type    WeaponType `protobuf:"varint,1,opt,name=type,proto3,enum=brittonhayes.warhammer.sigmar.v1.WeaponType" json:"type,omitempty"`
	Name    string     `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Range   string     `protobuf:"bytes,3,opt,name=range,proto3" json:"range,omitempty"`
	Attacks string     `protobuf:"bytes,4,opt,name=attacks,proto3" json:"attacks,omitempty"`
	ToHit   string     `protobuf:"bytes,5,opt,name=to_hit,json=toHit,proto3" json:"to_hit,omitempty"`
	ToWound string     `protobuf:"bytes,6,opt,name=to_wound,json=toWound,proto3" json:"to_wound,omitempty"`
	Rend    string     `protobuf:"bytes,7,opt,name=rend,proto3" json:"rend,omitempty"`
	Damage  string     `protobuf:"bytes,8,opt,name=damage,proto3" json:"damage,omitempty"`
	// contains filtered or unexported fields
}

func (*Weapon) Descriptor deprecated

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

Deprecated: Use Weapon.ProtoReflect.Descriptor instead.

func (*Weapon) GetAttacks

func (x *Weapon) GetAttacks() string

func (*Weapon) GetDamage

func (x *Weapon) GetDamage() string

func (*Weapon) GetName

func (x *Weapon) GetName() string

func (*Weapon) GetRange

func (x *Weapon) GetRange() string

func (*Weapon) GetRend

func (x *Weapon) GetRend() string

func (*Weapon) GetToHit

func (x *Weapon) GetToHit() string

func (*Weapon) GetToWound

func (x *Weapon) GetToWound() string

func (*Weapon) GetType

func (x *Weapon) GetType() WeaponType

func (*Weapon) ProtoMessage

func (*Weapon) ProtoMessage()

func (*Weapon) ProtoReflect

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

func (*Weapon) Reset

func (x *Weapon) Reset()

func (*Weapon) String

func (x *Weapon) String() string

type WeaponType

type WeaponType int32
const (
	WeaponType_WEAPON_TYPE_NONE   WeaponType = 0
	WeaponType_WEAPON_TYPE_MELEE  WeaponType = 1
	WeaponType_WEAPON_TYPE_RANGED WeaponType = 2
)

func (WeaponType) Descriptor

func (WeaponType) Descriptor() protoreflect.EnumDescriptor

func (WeaponType) Enum

func (x WeaponType) Enum() *WeaponType

func (WeaponType) EnumDescriptor deprecated

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

Deprecated: Use WeaponType.Descriptor instead.

func (WeaponType) Number

func (x WeaponType) Number() protoreflect.EnumNumber

func (WeaponType) String

func (x WeaponType) String() string

func (WeaponType) Type

Jump to

Keyboard shortcuts

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