Documentation
¶
Index ¶
- Constants
- Variables
- func StrPtr(s string) *string
- func Template() string
- type Author
- type Container
- func (c *Container) Check() error
- func (*Container) Descriptor() ([]byte, []int)deprecated
- func (x *Container) GetImage() string
- func (x *Container) GetPorts() []string
- func (x *Container) GetResource() *Resource
- func (*Container) ProtoMessage()
- func (x *Container) ProtoReflect() protoreflect.Message
- func (x *Container) Reset()
- func (x *Container) String() string
- type Meta
- func (t *Meta) Check() error
- func (*Meta) Descriptor() ([]byte, []int)deprecated
- func (x *Meta) GetAuthor() *Author
- func (x *Meta) GetContainers() []*Container
- func (x *Meta) GetTask() *Task
- func (t *Meta) ParseFormat() *Meta
- func (*Meta) ProtoMessage()
- func (x *Meta) ProtoReflect() protoreflect.Message
- func (m *Meta) R() *Meta
- func (x *Meta) Reset()
- func (x *Meta) String() string
- type Resource
- type Task
- func (t *Task) Check() error
- func (*Task) Descriptor() ([]byte, []int)deprecated
- func (x *Task) GetAttachmentUrl() string
- func (x *Task) GetCategory() string
- func (x *Task) GetDescription() string
- func (x *Task) GetFlag() string
- func (x *Task) GetId() string
- func (x *Task) GetLevel() string
- func (x *Task) GetLevelCode() Task_Level
- func (x *Task) GetName() string
- func (x *Task) GetRefer() string
- func (x *Task) GetTags() []string
- func (x *Task) GetType() string
- func (x *Task) GetTypeCode() Task_Type
- func (t *Task) ParseFormat() *Task
- func (*Task) ProtoMessage()
- func (x *Task) ProtoReflect() protoreflect.Message
- func (x *Task) Reset()
- func (x *Task) String() string
- type Task_Level
- type Task_Type
Constants ¶
View Source
const ( TaskIDSpec = `[^a-z0-9][a-z0-9_\-]{12,94}[a-z0-9]$` ImageSpec = TaskIDSpec )
Variables ¶
View Source
var ( Task_Type_name = map[int32]string{ 0: "UnknownType", 1: "Con", 2: "File", 3: "Ext", } Task_Type_value = map[string]int32{ "UnknownType": 0, "Con": 1, "File": 2, "Ext": 3, } )
Enum value maps for Task_Type.
View Source
var ( Task_Level_name = map[int32]string{ 0: "UnknownLevel", 1: "Checkin", 2: "Easy", 3: "Medium", 4: "Hard", } Task_Level_value = map[string]int32{ "UnknownLevel": 0, "Checkin": 1, "Easy": 2, "Medium": 3, "Hard": 4, } )
Enum value maps for Task_Level.
View Source
var File_meta_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type Author ¶
type Author struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Nickname 制作者ID Contact string `protobuf:"bytes,2,opt,name=contact,proto3" json:"contact,omitempty"` // Email 制作者邮箱 // contains filtered or unexported fields }
题目制作者信息
func (*Author) Descriptor
deprecated
added in
v1.0.9
func (*Author) GetContact ¶ added in v1.0.9
func (*Author) ProtoMessage ¶ added in v1.0.9
func (*Author) ProtoMessage()
func (*Author) ProtoReflect ¶ added in v1.0.9
func (x *Author) ProtoReflect() protoreflect.Message
type Container ¶ added in v1.0.9
type Container struct { Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` // 命名空间/镜像名称 Ports []string `protobuf:"bytes,2,rep,name=ports,proto3" json:"ports,omitempty"` // 需要对外暴露的端口,port/protocol eg .80/tcp Resource *Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` // 运行资源限制 // contains filtered or unexported fields }
func (*Container) Descriptor
deprecated
added in
v1.0.9
func (*Container) GetResource ¶ added in v1.0.9
func (*Container) ProtoMessage ¶ added in v1.0.9
func (*Container) ProtoMessage()
func (*Container) ProtoReflect ¶ added in v1.0.9
func (x *Container) ProtoReflect() protoreflect.Message
type Meta ¶
type Meta struct { Author *Author `protobuf:"bytes,1,opt,name=author,proto3" json:"author,omitempty"` Task *Task `protobuf:"bytes,2,opt,name=task,proto3" json:"task,omitempty"` Containers []*Container `protobuf:"bytes,3,rep,name=containers,proto3" json:"containers,omitempty"` // contains filtered or unexported fields }
题目元信息
func MustParseBytes ¶ added in v1.0.12
func ParseBytes ¶ added in v1.0.8
func ParseFromFile ¶ added in v1.0.8
func ParseFromFile(fds ...io.ReadSeekCloser) ([]*Meta, error)
func (*Meta) Descriptor
deprecated
added in
v1.0.9
func (*Meta) GetContainers ¶ added in v1.0.11
func (*Meta) ParseFormat ¶ added in v1.0.11
func (*Meta) ProtoMessage ¶ added in v1.0.9
func (*Meta) ProtoMessage()
func (*Meta) ProtoReflect ¶ added in v1.0.9
func (x *Meta) ProtoReflect() protoreflect.Message
type Resource ¶ added in v1.0.9
type Resource struct { // k8s.io.apimachinery.pkg.api.resource.Quantity Cpu string `protobuf:"bytes,1,opt,name=cpu,proto3" json:"cpu,omitempty"` Mem string `protobuf:"bytes,2,opt,name=mem,proto3" json:"mem,omitempty"` // contains filtered or unexported fields }
func (*Resource) Descriptor
deprecated
added in
v1.0.9
func (*Resource) ProtoMessage ¶ added in v1.0.9
func (*Resource) ProtoMessage()
func (*Resource) ProtoReflect ¶ added in v1.0.9
func (x *Resource) ProtoReflect() protoreflect.Message
type Task ¶
type Task struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // 题目ID 唯一值 Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // 题目名称 Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` // 题目类型 - con,file,ext Category string `protobuf:"bytes,4,opt,name=category,proto3" json:"category,omitempty"` // 题目分类 Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` // 题目描述 Level string `protobuf:"bytes,6,opt,name=level,proto3" json:"level,omitempty"` // 题目难度 Flag *string `protobuf:"bytes,7,opt,name=flag,proto3,oneof" json:"flag,omitempty"` // 题目 Flag, 不填写则为动态 Flag AttachmentUrl *string `protobuf:"bytes,8,opt,name=attachment_url,json=attachmentUrl,proto3,oneof" json:"attachment_url,omitempty"` // 题目附件地址 Refer *string `protobuf:"bytes,9,opt,name=refer,proto3,oneof" json:"refer,omitempty"` // 题目来源 Tags []string `protobuf:"bytes,10,rep,name=tags,proto3" json:"tags,omitempty"` // 题目标签 TypeCode Task_Type `protobuf:"varint,91,opt,name=type_code,json=typeCode,proto3,enum=ctfhub.meta.Task_Type" json:"type_code,omitempty"` LevelCode Task_Level `protobuf:"varint,92,opt,name=level_code,json=levelCode,proto3,enum=ctfhub.meta.Task_Level" json:"level_code,omitempty"` // contains filtered or unexported fields }
题目信息
func (*Task) Descriptor
deprecated
added in
v1.0.9
func (*Task) GetAttachmentUrl ¶ added in v1.0.9
func (*Task) GetCategory ¶ added in v1.0.9
func (*Task) GetDescription ¶ added in v1.0.9
func (*Task) GetLevelCode ¶ added in v1.0.9
func (x *Task) GetLevelCode() Task_Level
func (*Task) GetTypeCode ¶ added in v1.0.9
func (*Task) ParseFormat ¶ added in v1.0.11
func (*Task) ProtoMessage ¶ added in v1.0.9
func (*Task) ProtoMessage()
func (*Task) ProtoReflect ¶ added in v1.0.9
func (x *Task) ProtoReflect() protoreflect.Message
type Task_Level ¶ added in v1.1.0
type Task_Level int32
const ( Task_UnknownLevel Task_Level = 0 Task_Checkin Task_Level = 1 // 签到-入门 Task_Easy Task_Level = 2 // 简单-初级 Task_Medium Task_Level = 3 // 中等-中级 Task_Hard Task_Level = 4 // 困难-高级 )
func (Task_Level) Descriptor ¶ added in v1.1.0
func (Task_Level) Descriptor() protoreflect.EnumDescriptor
func (Task_Level) Enum ¶ added in v1.1.0
func (x Task_Level) Enum() *Task_Level
func (Task_Level) EnumDescriptor
deprecated
added in
v1.1.0
func (Task_Level) EnumDescriptor() ([]byte, []int)
Deprecated: Use Task_Level.Descriptor instead.
func (Task_Level) Number ¶ added in v1.1.0
func (x Task_Level) Number() protoreflect.EnumNumber
func (Task_Level) String ¶ added in v1.1.0
func (x Task_Level) String() string
func (Task_Level) Type ¶ added in v1.1.0
func (Task_Level) Type() protoreflect.EnumType
type Task_Type ¶ added in v1.1.0
type Task_Type int32
func (Task_Type) Descriptor ¶ added in v1.1.0
func (Task_Type) Descriptor() protoreflect.EnumDescriptor
func (Task_Type) EnumDescriptor
deprecated
added in
v1.1.0
func (Task_Type) Number ¶ added in v1.1.0
func (x Task_Type) Number() protoreflect.EnumNumber
func (Task_Type) Type ¶ added in v1.1.0
func (Task_Type) Type() protoreflect.EnumType
Click to show internal directories.
Click to hide internal directories.