Documentation ¶
Index ¶
- func CheckIsAdmin(ctx context.Context) (bool, error)
- type ACLMutation
- type HMachine
- type HMachineMutation
- type HRoute
- type HRouteMutation
- type HUser
- type HUserMutation
- type HasID
- type HeadscaleMutation
- type HeadscaleQuery
- type Machine
- type MachineInput
- type MachineMutation
- type Project
- type ProjectInput
- type ProjectMutation
- type Route
- type RouteInput
- type RouteMutation
- type SyncResult
- type Timestamp
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ACLMutation ¶ added in v1.3.1
type ACLMutation struct {
TriggerUpdate bool `json:"triggerUpdate"`
}
type HMachine ¶ added in v1.1.0
type HMachine struct { ID int `json:"id"` IPAddresses []string `json:"ip_addresses,omitempty"` Name string `json:"name"` LastSeen *Timestamp `json:"last_seen,omitempty"` ForcedTags []string `json:"forced_tags,omitempty"` GivenName string `json:"given_name,omitempty"` Online bool `json:"online"` User *HUser `json:"user,omitempty"` Routes []*HRoute `json:"routes"` }
Headscale Machine
func ToHMachine ¶ added in v1.1.0
type HMachineMutation ¶ added in v1.1.0
type HRoute ¶ added in v1.1.0
type HRoute struct { ID int `json:"id"` Machine *HMachine `json:"machine,omitempty"` Prefix string `json:"prefix"` Advertised bool `json:"advertised"` Enabled bool `json:"enabled"` IsPrimary bool `json:"is_primary,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` DeletedAt *Timestamp `json:"deleted_at,omitempty"` }
type HRouteMutation ¶ added in v1.1.0
type HUser ¶ added in v1.1.0
type HUser struct { ID string `json:"id"` Name string `json:"name"` CreatedAt *Timestamp `json:"created_at,omitempty"` }
Headscale User
type HUserMutation ¶ added in v1.2.0
type HeadscaleMutation ¶ added in v1.1.0
type HeadscaleMutation struct { Route *HRouteMutation `json:"route,omitempty"` Machine *HMachineMutation `json:"machine,omitempty"` User *HUserMutation `json:"user,omitempty"` }
type HeadscaleQuery ¶ added in v1.1.0
type Machine ¶
type Machine struct { ID *string `json:"id,omitempty" bson:"_id"` // 名称 Name *string `json:"name,omitempty"` }
机器
type MachineInput ¶
func (*MachineInput) GetID ¶
func (input *MachineInput) GetID() *string
func (*MachineInput) ToBson ¶
func (machine *MachineInput) ToBson() *bson.M
type MachineMutation ¶
type Project ¶
type Project struct { ID *string `json:"id,omitempty" bson:"_id"` // 项目编码 Code *string `json:"code,omitempty"` // 项目名称 Name *string `json:"name,omitempty"` // 当前机器 Machine *Machine `json:"machine,omitempty" bson:"-"` // 可用机器 Machines []*Machine `json:"machines,omitempty" bson:"-"` // 当前机器ID MachineID *string `json:"machineID,omitempty" bson:"machine"` // 可用机器ID MachineIDs []*string `json:"machineIDs,omitempty" bson:"machines"` Routes []*Route `json:"routes,omitempty" bson:"-"` }
项目
type ProjectInput ¶
type ProjectInput struct { ID *string `json:"id,omitempty"` Code *string `json:"code,omitempty"` Name *string `json:"name,omitempty"` MachineID *string `json:"machineID,omitempty"` MachineIDs []*string `json:"machineIDs,omitempty"` }
func (*ProjectInput) GetID ¶
func (input *ProjectInput) GetID() *string
func (*ProjectInput) ToBson ¶
func (project *ProjectInput) ToBson() *bson.M
type ProjectMutation ¶
type ProjectMutation struct { SaveProject *Project `json:"saveProject,omitempty"` DeleteProject int `json:"deleteProject"` SyncProjectRoute []*SyncResult `json:"syncProjectRoute,omitempty"` }
type Route ¶
type Route struct { ID *string `json:"id,omitempty" bson:"_id"` // 地址 Name *string `json:"name,omitempty"` // 描述 Description *string `json:"description,omitempty"` // 项目 Project *Project `json:"project,omitempty" bson:"-"` ProjectID *string `json:"projectID,omitempty" bson:"project"` }
路由
type RouteInput ¶
type RouteInput struct { ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` ProjectID *string `json:"projectID,omitempty"` }
func (*RouteInput) GetID ¶
func (input *RouteInput) GetID() *string
func (*RouteInput) ToBson ¶
func (route *RouteInput) ToBson() *bson.M
type RouteMutation ¶
type SyncResult ¶
type SyncResult struct { ProjectID string `json:"projectID"` Project *Project `json:"project,omitempty"` RouteID string `json:"routeID"` Route *Route `json:"route,omitempty"` MachineID string `json:"machineID"` Machine *Machine `json:"machine,omitempty"` // 路由是否启用 RouteEnable bool `json:"routeEnable"` }
项目路由同步结果
type Timestamp ¶ added in v1.1.0
func ToTimestamp ¶ added in v1.1.0
func ToTimestamp(t *timestamppb.Timestamp) *Timestamp
Click to show internal directories.
Click to hide internal directories.