inventory

package
v0.0.0-...-4b6388e Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type ComplexityRoot

type ComplexityRoot struct {
	Group struct {
		CreateTime  func(childComplexity int) int
		Description func(childComplexity int) int
		Name        func(childComplexity int) int
		UpdateTime  func(childComplexity int) int
	}

	Host struct {
		CreateTime              func(childComplexity int) int
		Description             func(childComplexity int) int
		Name                    func(childComplexity int) int
		RemotePythonInterpreter func(childComplexity int) int
		UpdateTime              func(childComplexity int) int
	}

	Mutation struct {
		CreateGroup          func(childComplexity int, input GroupInput) int
		CreateHost           func(childComplexity int, input HostInput) int
		CreateHostBelong     func(childComplexity int, input HostBelongInput) int
		CreateRemoteUserPass func(childComplexity int, input UserPassInput) int
		DeleteGroup          func(childComplexity int, name string) int
		DeleteHost           func(childComplexity int, name string) int
		DeleteHostBelong     func(childComplexity int, input HostBelongInput) int
		DeleteRemoteUserPass func(childComplexity int, name DeleteUserPassInput) int
		UpdateGroup          func(childComplexity int, input GroupInput) int
		UpdateHost           func(childComplexity int, input SetHostInput) int
		UpdateRemoteUserPass func(childComplexity int, input UserPassInput) int
	}

	Query struct {
		GroupHas    func(childComplexity int, groupName string) int
		Groups      func(childComplexity int, name *string) int
		HostHasUser func(childComplexity int, hostName string) int
		Hosts       func(childComplexity int, name *string) int
	}

	RemoteUserPass struct {
		RemotePass func(childComplexity int) int
		RemoteUser func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DeleteUserPassInput

type DeleteUserPassInput struct {
	// 主机ip/hostname
	Host string `json:"host"`
	// 远程操作用户
	RemoteUser string `json:"remote_user"`
}

type DirectiveRoot

type DirectiveRoot struct {
}

type Group

type Group struct {
	// 主机分组名称
	Name string `json:"name"`
	// 主机分组描述
	Description string `json:"description"`
	// 创建时间
	CreateTime string `json:"createTime"`
	// 更新时间
	UpdateTime string `json:"updateTime"`
}

type GroupInput

type GroupInput struct {
	// 分组名称
	Name string `json:"name"`
	// 分组描述
	Description string `json:"description"`
}

type Host

type Host struct {
	// 主机名
	Name string `json:"name"`
	// 主机描述
	Description string `json:"description"`
	// 远程主机的python解释器(默认为/usr/bin/python)
	RemotePythonInterpreter string `json:"remote_python_interpreter"`
	// 创建时间
	CreateTime string `json:"createTime"`
	// 更新时间
	UpdateTime string `json:"updateTime"`
}

type HostBelongInput

type HostBelongInput struct {
	// 主机名称
	HostName string `json:"hostName"`
	// 角色名称
	GroupName string `json:"groupName"`
}

type HostInput

type HostInput struct {
	// 主机名称
	Name string `json:"name"`
	// 主机描述
	Description string `json:"description"`
	// python解释器
	RemotePythonInterpreter string `json:"remote_python_interpreter"`
}

type MutationResolver

type MutationResolver interface {
	CreateGroup(ctx context.Context, input GroupInput) (*Group, error)
	UpdateGroup(ctx context.Context, input GroupInput) (*Group, error)
	DeleteGroup(ctx context.Context, name string) (bool, error)
	CreateHost(ctx context.Context, input HostInput) (*Host, error)
	UpdateHost(ctx context.Context, input SetHostInput) (*Host, error)
	DeleteHost(ctx context.Context, name string) (bool, error)
	CreateRemoteUserPass(ctx context.Context, input UserPassInput) (*RemoteUserPass, error)
	UpdateRemoteUserPass(ctx context.Context, input UserPassInput) (*RemoteUserPass, error)
	DeleteRemoteUserPass(ctx context.Context, name DeleteUserPassInput) (bool, error)
	CreateHostBelong(ctx context.Context, input HostBelongInput) (bool, error)
	DeleteHostBelong(ctx context.Context, input HostBelongInput) (bool, error)
}

type QueryResolver

type QueryResolver interface {
	Groups(ctx context.Context, name *string) ([]*Group, error)
	Hosts(ctx context.Context, name *string) ([]*Host, error)
	GroupHas(ctx context.Context, groupName string) ([]*Host, error)
	HostHasUser(ctx context.Context, hostName string) ([]*RemoteUserPass, error)
}

type RemoteUserPass

type RemoteUserPass struct {
	// 远程操作用户
	RemoteUser string `json:"remote_user"`
	// 远程操作用户密码
	RemotePass string `json:"remote_pass"`
}

type Resolver

type Resolver struct{}

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

type ResolverRoot

type ResolverRoot interface {
	Mutation() MutationResolver
	Query() QueryResolver
}

type SetHostInput

type SetHostInput struct {
	// 主机名称
	Name *string `json:"name"`
	// 主机描述
	Description *string `json:"description"`
	// python解释器
	RemotePythonInterpreter *string `json:"remote_python_interpreter"`
}

type UserPassInput

type UserPassInput struct {
	// 主机ip/hostname
	Host string `json:"host"`
	// 远程操作用户(host/ip@username)
	RemoteUser string `json:"remote_user"`
	// 远程操作用户密码
	RemotePass string `json:"remote_pass"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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