Documentation ¶
Index ¶
- Constants
- Variables
- func Admin(c *macaron.Context)
- func AllocateAddress(ctx context.Context, subnetID, ifaceID int64, ipaddr, addrType string) (address *model.Address, err error)
- func AllocateFloatingIp(ctx context.Context, floatingipID, owner int64, gateway *model.Gateway, ...) (fipIface *model.Interface, err error)
- func CreateInterface(ctx context.Context, subnetID, ID, owner, zoneID int64, hyper int32, ...) (iface *model.Interface, err error)
- func DeallocateAddress(ctx context.Context, ifaces []*model.Interface) (err error)
- func DeallocateFloatingIp(ctx context.Context, floatingipID int64) (err error)
- func DeleteInterface(ctx context.Context, iface *model.Interface) (err error)
- func DeleteInterfaces(ctx context.Context, masterID, subnetID int64, ifType string) (err error)
- func FileExist(filename string) bool
- func Index(c *macaron.Context, store session.Store)
- func LinkHandler(c *macaron.Context, store session.Store)
- func MakeToken(instanceID int, secret string, memberShip *MemberShip) (string, error)
- func New() (m *macaron.Macaron)
- func NewClaims(u, o, uid, oid string, role model.Role) (claims jwt.Claims, issuedAt, ExpiresAt int64)
- func NewToken(u, o, uid, oid string, role model.Role) (signed string, issueAt, expiresAt int64, err error)
- func RandomStr() string
- func Run() (err error)
- func SetGateway(ctx context.Context, subnetID, zoneID, owner int64, router *model.Gateway) (subnet *model.Subnet, iface *model.Interface, err error)
- func UnsetGateway(ctx context.Context, subnet *model.Subnet) (err error)
- type ConsoleAdmin
- type ConsoleInfo
- type ConsoleView
- type Dashboard
- type FlavorAdmin
- type FlavorView
- type FloatingIpAdmin
- func (a *FloatingIpAdmin) Create(ctx context.Context, instID, ifaceID int64, types []string, ...) (floatingips []*model.FloatingIp, err error)
- func (a *FloatingIpAdmin) Delete(ctx context.Context, id int64) (err error)
- func (a *FloatingIpAdmin) List(ctx context.Context, offset, limit int64, order, query string) (total int64, floatingips []*model.FloatingIp, err error)
- type FloatingIpView
- func (v *FloatingIpView) Assign(c *macaron.Context, store session.Store)
- func (v *FloatingIpView) Create(c *macaron.Context, store session.Store)
- func (v *FloatingIpView) Delete(c *macaron.Context, store session.Store) (err error)
- func (v *FloatingIpView) List(c *macaron.Context, store session.Store)
- func (v *FloatingIpView) New(c *macaron.Context, store session.Store)
- type FloatingIps
- type GatewayAdmin
- func (a *GatewayAdmin) Create(ctx context.Context, name, stype string, pubID, priID int64, subnetIDs []int64, ...) (gateway *model.Gateway, err error)
- func (a *GatewayAdmin) Delete(ctx context.Context, id int64) (err error)
- func (a *GatewayAdmin) List(ctx context.Context, offset, limit int64, order, query string) (total int64, gateways []*model.Gateway, err error)
- func (a *GatewayAdmin) Update(ctx context.Context, id int64, name string, pubID, priID int64, ...) (gateway *model.Gateway, err error)
- type GatewayView
- func (v *GatewayView) Create(c *macaron.Context, store session.Store)
- func (v *GatewayView) Delete(c *macaron.Context, store session.Store) (err error)
- func (v *GatewayView) Edit(c *macaron.Context, store session.Store)
- func (v *GatewayView) List(c *macaron.Context, store session.Store)
- func (v *GatewayView) New(c *macaron.Context, store session.Store)
- func (v *GatewayView) Patch(c *macaron.Context, store session.Store)
- type GlusterfsAdmin
- func (a *GlusterfsAdmin) Create(ctx context.Context, name, cookie string, nworkers int32, ...) (glusterfs *model.Glusterfs, err error)
- func (a *GlusterfsAdmin) Delete(ctx context.Context, id int64) (err error)
- func (a *GlusterfsAdmin) GetState(ctx context.Context, id int64) (status string, err error)
- func (a *GlusterfsAdmin) List(ctx context.Context, offset, limit int64, order, query string) (total int64, glusterfses []*model.Glusterfs, err error)
- func (a *GlusterfsAdmin) State(ctx context.Context, id int64, status string, nworkers int32) (err error)
- func (a *GlusterfsAdmin) Update(ctx context.Context, id, heketiKey, flavorID int64, nworkers int32) (glusterfs *model.Glusterfs, err error)
- type GlusterfsView
- func (v *GlusterfsView) Create(c *macaron.Context, store session.Store)
- func (v *GlusterfsView) Delete(c *macaron.Context, store session.Store) (err error)
- func (v *GlusterfsView) Edit(c *macaron.Context, store session.Store)
- func (v *GlusterfsView) List(c *macaron.Context, store session.Store)
- func (v *GlusterfsView) New(c *macaron.Context, store session.Store)
- func (v *GlusterfsView) Patch(c *macaron.Context, store session.Store)
- func (v *GlusterfsView) State(c *macaron.Context, store session.Store)
- type HyperAdmin
- type HyperView
- type HypercubeClaims
- type ImageAdmin
- type ImageView
- type InstanceAdmin
- func (a *InstanceAdmin) ChangeInstanceStatus(ctx context.Context, id int64, action string) (instance *model.Instance, err error)
- func (a *InstanceAdmin) Create(ctx context.Context, count int, prefix, userdata string, ...) (instance *model.Instance, err error)
- func (a *InstanceAdmin) Delete(ctx context.Context, id int64) (err error)
- func (a *InstanceAdmin) List(ctx context.Context, offset, limit int64, order, query string) (total int64, instances []*model.Instance, err error)
- func (a *InstanceAdmin) Update(ctx context.Context, id, flavorID int64, hostname, action string, ...) (instance *model.Instance, err error)
- type InstanceData
- type InstanceNetwork
- type InstanceView
- func (v *InstanceView) Create(c *macaron.Context, store session.Store)
- func (v *InstanceView) Delete(c *macaron.Context, store session.Store) (err error)
- func (v *InstanceView) Edit(c *macaron.Context, store session.Store)
- func (v *InstanceView) List(c *macaron.Context, store session.Store)
- func (v *InstanceView) New(c *macaron.Context, store session.Store)
- func (v *InstanceView) Patch(c *macaron.Context, store session.Store)
- func (v *InstanceView) UpdateTable(c *macaron.Context, store session.Store)
- type InstancesData
- type InterfaceAdmin
- type InterfaceView
- type KeyAdmin
- type KeyTemp
- type KeyView
- func (v *KeyView) Confirm(c *macaron.Context, store session.Store)
- func (v *KeyView) Create(c *macaron.Context, store session.Store)
- func (v *KeyView) Delete(c *macaron.Context, store session.Store) (err error)
- func (v *KeyView) List(c *macaron.Context, store session.Store)
- func (v *KeyView) New(c *macaron.Context, store session.Store)
- func (v *KeyView) SearchDbFingerPrint(c *macaron.Context, store session.Store, fingerPrint, publicKey, name string)
- func (v *KeyView) SolveListKeyError(c *macaron.Context, store session.Store)
- func (v *KeyView) SolvePrintedPublicKeyError(c *macaron.Context, store session.Store, err error)
- func (v *KeyView) SolvePublicKeyDbError(c *macaron.Context, store session.Store, name, publicKey, fingerPrint string)
- type MemberShip
- func (m *MemberShip) CheckAdmin(reqRole model.Role, table string, id int64) (admin bool, err error)
- func (m *MemberShip) CheckCreater(table string, id int64) (isCreater bool, err error)
- func (m *MemberShip) CheckOwner(reqRole model.Role, table string, id int64) (isOwner bool, err error)
- func (m *MemberShip) CheckPermission(reqRole model.Role) (permit bool)
- func (m *MemberShip) CheckUser(id int64) (permit bool, err error)
- func (m *MemberShip) GetWhere() (where string)
- func (m *MemberShip) SetContext(ctx context.Context) context.Context
- type NetworkLink
- type NetworkRoute
- type OcpData
- type OpenshiftAdmin
- func (a *OpenshiftAdmin) Create(ctx context.Context, cluster, domain, cookie, haflag, extIP string, ...) (openshift *model.Openshift, err error)
- func (a *OpenshiftAdmin) Delete(ctx context.Context, id int64) (err error)
- func (a *OpenshiftAdmin) GetState(ctx context.Context, id int64) (status string, err error)
- func (a *OpenshiftAdmin) Launch(ctx context.Context, id int64, hostname, ipaddr string) (instance *model.Instance, err error)
- func (a *OpenshiftAdmin) List(ctx context.Context, offset, limit int64, order, query string) (total int64, openshifts []*model.Openshift, err error)
- func (a *OpenshiftAdmin) State(ctx context.Context, id int64, status string) (err error)
- func (a *OpenshiftAdmin) Update(ctx context.Context, id, flavorID int64, nworkers int32) (openshift *model.Openshift, err error)
- type OpenshiftView
- func (v *OpenshiftView) Create(c *macaron.Context, store session.Store)
- func (v *OpenshiftView) Delete(c *macaron.Context, store session.Store) (err error)
- func (v *OpenshiftView) Edit(c *macaron.Context, store session.Store)
- func (v *OpenshiftView) Launch(c *macaron.Context, store session.Store)
- func (v *OpenshiftView) List(c *macaron.Context, store session.Store)
- func (v *OpenshiftView) New(c *macaron.Context, store session.Store)
- func (v *OpenshiftView) Patch(c *macaron.Context, store session.Store)
- func (v *OpenshiftView) State(c *macaron.Context, store session.Store)
- type OrgAdmin
- func (a *OrgAdmin) Create(ctx context.Context, name, owner string) (org *model.Organization, err error)
- func (a *OrgAdmin) Delete(ctx context.Context, id int64) (err error)
- func (a *OrgAdmin) Get(name string) (org *model.Organization, err error)
- func (a *OrgAdmin) List(ctx context.Context, offset, limit int64, order, query string) (total int64, orgs []*model.Organization, err error)
- func (a *OrgAdmin) Update(ctx context.Context, orgID int64, members, users []string, roles []model.Role) (org *model.Organization, err error)
- type OrgView
- func (v *OrgView) Create(c *macaron.Context, store session.Store)
- func (v *OrgView) Delete(c *macaron.Context, store session.Store) (err error)
- func (v *OrgView) Edit(c *macaron.Context, store session.Store)
- func (v *OrgView) List(c *macaron.Context, store session.Store)
- func (v *OrgView) New(c *macaron.Context, store session.Store)
- func (v *OrgView) Patch(c *macaron.Context, store session.Store)
- type Page
- type PortmapAdmin
- func (a *PortmapAdmin) Create(ctx context.Context, instID int64, port int) (portmap *model.Portmap, err error)
- func (a *PortmapAdmin) Delete(ctx context.Context, id int64) (err error)
- func (a *PortmapAdmin) List(ctx context.Context, offset, limit int64, order, query string) (total int64, portmaps []*model.Portmap, err error)
- type PortmapView
- type RegistryAdmin
- func (a *RegistryAdmin) Create(ctx context.Context, ...) (registry *model.Registry, err error)
- func (a *RegistryAdmin) Delete(id int64) (err error)
- func (a *RegistryAdmin) List(offset, limit int64, order, query string) (total int64, registrys []*model.Registry, err error)
- func (a *RegistryAdmin) Update(ctx context.Context, id int64, ...) (registry *model.Registry, err error)
- type RegistryView
- func (v *RegistryView) Create(c *macaron.Context, store session.Store)
- func (v *RegistryView) Delete(c *macaron.Context, store session.Store) (err error)
- func (v *RegistryView) Edit(c *macaron.Context, store session.Store)
- func (v *RegistryView) List(c *macaron.Context, store session.Store)
- func (v *RegistryView) New(c *macaron.Context, store session.Store)
- func (v *RegistryView) Patch(c *macaron.Context, store session.Store)
- type ResourceData
- type SecgroupAdmin
- func (a *SecgroupAdmin) Create(ctx context.Context, name string, isDefault bool, owner int64) (secgroup *model.SecurityGroup, err error)
- func (a *SecgroupAdmin) Delete(id int64) (err error)
- func (a *SecgroupAdmin) List(ctx context.Context, offset, limit int64, order, query string) (total int64, secgroups []*model.SecurityGroup, err error)
- func (a *SecgroupAdmin) Switch(ctx context.Context, newSg *model.SecurityGroup, store session.Store) (err error)
- func (a *SecgroupAdmin) Update(ctx context.Context, sgID int64, name string, isDefault bool) (secgroup *model.SecurityGroup, err error)
- type SecgroupView
- func (v *SecgroupView) Create(c *macaron.Context, store session.Store)
- func (v *SecgroupView) Delete(c *macaron.Context, store session.Store) (err error)
- func (v *SecgroupView) Edit(c *macaron.Context, store session.Store)
- func (v *SecgroupView) List(c *macaron.Context, store session.Store)
- func (v *SecgroupView) New(c *macaron.Context, store session.Store)
- func (v *SecgroupView) Patch(c *macaron.Context, store session.Store)
- type SecruleAdmin
- func (a *SecruleAdmin) ApplySecgroup(ctx context.Context, secgroup *model.SecurityGroup, ruleID int64) (err error)
- func (a *SecruleAdmin) Create(ctx context.Context, sgID, owner int64, remoteIp, direction, protocol string, ...) (secrule *model.SecurityRule, err error)
- func (a *SecruleAdmin) Delete(ctx context.Context, sgID, id int64) (err error)
- func (a *SecruleAdmin) List(ctx context.Context, offset, limit int64, order string, secgroupID int64) (total int64, secrules []*model.SecurityRule, err error)
- func (a *SecruleAdmin) Update(ctx context.Context, id int64, remoteIp, direction, protocol string, ...) (secrule *model.SecurityRule, err error)
- type SecruleView
- func (v *SecruleView) Create(c *macaron.Context, store session.Store)
- func (v *SecruleView) Delete(c *macaron.Context, store session.Store) (err error)
- func (v *SecruleView) Edit(c *macaron.Context, store session.Store)
- func (v *SecruleView) List(c *macaron.Context, store session.Store)
- func (v *SecruleView) New(c *macaron.Context, store session.Store)
- func (v *SecruleView) Patch(c *macaron.Context, store session.Store)
- type SecurityData
- type StaticRoute
- type SubnetAdmin
- func (a *SubnetAdmin) Create(ctx context.Context, ...) (subnet *model.Subnet, err error)
- func (a *SubnetAdmin) Delete(ctx context.Context, id int64) (err error)
- func (a *SubnetAdmin) List(ctx context.Context, offset, limit int64, order, query, sql string) (total int64, subnets []*model.Subnet, err error)
- func (a *SubnetAdmin) Update(ctx context.Context, id int64, name, gateway, start, end, dns, routes string) (subnet *model.Subnet, err error)
- type SubnetIface
- type SubnetView
- func (v *SubnetView) Create(c *macaron.Context, store session.Store)
- func (v *SubnetView) Delete(c *macaron.Context, store session.Store) (err error)
- func (v *SubnetView) Edit(c *macaron.Context, store session.Store)
- func (v *SubnetView) List(c *macaron.Context, store session.Store)
- func (v *SubnetView) New(c *macaron.Context, store session.Store)
- func (v *SubnetView) Patch(c *macaron.Context, store session.Store)
- type TokenClaim
- type UserAdmin
- func (a *UserAdmin) AccessToken(uid int64, username, organization string) (oid int64, role model.Role, token string, issueAt, expiresAt int64, err error)
- func (a *UserAdmin) CompareHashAndPassword(hash, password string) (err error)
- func (a *UserAdmin) Create(ctx context.Context, username, password string) (user *model.User, err error)
- func (a *UserAdmin) Delete(id int64) (err error)
- func (a *UserAdmin) GenerateFromPassword(password string) (hash string, err error)
- func (a *UserAdmin) List(ctx context.Context, offset, limit int64, order, query string) (total int64, users []*model.User, err error)
- func (a *UserAdmin) Update(ctx context.Context, id int64, password string, members []string) (user *model.User, err error)
- func (a *UserAdmin) Validate(ctx context.Context, username, password string) (user *model.User, err error)
- type UserView
- func (v *UserView) Change(c *macaron.Context, store session.Store)
- func (v *UserView) Create(c *macaron.Context, store session.Store)
- func (v *UserView) Delete(c *macaron.Context, store session.Store) (err error)
- func (v *UserView) Edit(c *macaron.Context, store session.Store)
- func (v *UserView) List(c *macaron.Context, store session.Store)
- func (v *UserView) LoginGet(c *macaron.Context, store session.Store)
- func (v *UserView) LoginPost(c *macaron.Context, store session.Store)
- func (v *UserView) New(c *macaron.Context, store session.Store)
- func (v *UserView) Patch(c *macaron.Context, store session.Store)
- type VlanInfo
- type VolumeAdmin
- func (a *VolumeAdmin) Create(ctx context.Context, name string, size int) (volume *model.Volume, err error)
- func (a *VolumeAdmin) Delete(ctx context.Context, id int64) (err error)
- func (a *VolumeAdmin) List(ctx context.Context, offset, limit int64, order, query string) (total int64, volumes []*model.Volume, err error)
- func (a *VolumeAdmin) Update(ctx context.Context, id int64, name string, instID int64) (volume *model.Volume, err error)
- type VolumeView
- func (v *VolumeView) Create(c *macaron.Context, store session.Store)
- func (v *VolumeView) Delete(c *macaron.Context, store session.Store) (err error)
- func (v *VolumeView) Edit(c *macaron.Context, store session.Store)
- func (v *VolumeView) List(c *macaron.Context, store session.Store)
- func (v *VolumeView) New(c *macaron.Context, store session.Store)
- func (v *VolumeView) Patch(c *macaron.Context, store session.Store)
- type ZvmData
Constants ¶
View Source
const (
TokenExpireDuration = time.Hour * 2
)
Variables ¶
View Source
var (
DB = dbs.DB
)
View Source
var SignedSeret = []byte("Red B")
View Source
var UrlBefore string
Functions ¶
func AllocateAddress ¶
func AllocateFloatingIp ¶
func CreateInterface ¶
func DeallocateAddress ¶
func DeallocateFloatingIp ¶
func DeleteInterface ¶
func DeleteInterfaces ¶
func LinkHandler ¶
func MakeToken ¶
func MakeToken(instanceID int, secret string, memberShip *MemberShip) (string, error)
func SetGateway ¶
Types ¶
type ConsoleAdmin ¶
type ConsoleAdmin struct{}
type ConsoleInfo ¶
type ConsoleView ¶
type ConsoleView struct{}
func (*ConsoleView) ConsoleResolve ¶
func (a *ConsoleView) ConsoleResolve(c *macaron.Context, store session.Store)
func (*ConsoleView) ConsoleURL ¶
func (a *ConsoleView) ConsoleURL(c *macaron.Context, store session.Store)
type FlavorAdmin ¶
type FlavorAdmin struct{}
func (*FlavorAdmin) Delete ¶
func (a *FlavorAdmin) Delete(id int64) (err error)
type FloatingIpAdmin ¶
type FloatingIpAdmin struct{}
func (*FloatingIpAdmin) Create ¶
func (a *FloatingIpAdmin) Create(ctx context.Context, instID, ifaceID int64, types []string, publicIp, privateIp string) (floatingips []*model.FloatingIp, err error)
type FloatingIpView ¶
type FloatingIpView struct{}
func (*FloatingIpView) Assign ¶
func (v *FloatingIpView) Assign(c *macaron.Context, store session.Store)
func (*FloatingIpView) Create ¶
func (v *FloatingIpView) Create(c *macaron.Context, store session.Store)
type FloatingIps ¶
type GatewayAdmin ¶
type GatewayAdmin struct{}
func (*GatewayAdmin) Delete ¶
func (a *GatewayAdmin) Delete(ctx context.Context, id int64) (err error)
type GlusterfsAdmin ¶
type GlusterfsAdmin struct{}
func (*GlusterfsAdmin) Delete ¶
func (a *GlusterfsAdmin) Delete(ctx context.Context, id int64) (err error)
type GlusterfsView ¶
type GlusterfsView struct{}
func (*GlusterfsView) Create ¶
func (v *GlusterfsView) Create(c *macaron.Context, store session.Store)
type HyperAdmin ¶
type HyperAdmin struct{}
type HypercubeClaims ¶
type HypercubeClaims struct { jwt.StandardClaims UID string `json:"uid,omitempty"` OID string `json:"oid,omitempty"` Role model.Role `json:"r,omitempty"` }
func ParseToken ¶
func ParseToken(tokenString string) (tokenClaims *HypercubeClaims, err error)
type InstanceAdmin ¶
type InstanceAdmin struct{}
func (*InstanceAdmin) ChangeInstanceStatus ¶
func (*InstanceAdmin) Delete ¶
func (a *InstanceAdmin) Delete(ctx context.Context, id int64) (err error)
type InstanceData ¶
type InstanceData struct { Userdata string `json:"userdata"` VirtType string `json:"virt_type"` DNS string `json:"dns"` ZVM []*ZvmData `json:"zvm"` OCP []*OcpData `json:"ocp"` Vlans []*VlanInfo `json:"vlans"` Networks []*InstanceNetwork `json:"networks"` Links []*NetworkLink `json:"links"` Keys []string `json:"keys"` SecRules []*SecurityData `json:"security"` }
type InstanceNetwork ¶
type InstanceView ¶
type InstanceView struct{}
func (*InstanceView) Create ¶
func (v *InstanceView) Create(c *macaron.Context, store session.Store)
func (*InstanceView) UpdateTable ¶
func (v *InstanceView) UpdateTable(c *macaron.Context, store session.Store)
type InstancesData ¶
type InterfaceAdmin ¶
type InterfaceAdmin struct{}
type InterfaceView ¶
type InterfaceView struct{}
func (*InterfaceView) Create ¶
func (v *InterfaceView) Create(c *macaron.Context, store session.Store)
type KeyView ¶
type KeyView struct{}
func (*KeyView) SearchDbFingerPrint ¶
func (*KeyView) SolveListKeyError ¶
func (*KeyView) SolvePrintedPublicKeyError ¶
type MemberShip ¶
func GetDBMemberShip ¶
func GetDBMemberShip(userID, orgID int64) (ms *MemberShip, err error)
func GetMemberShip ¶
func GetMemberShip(ctx context.Context) *MemberShip
func ResolveToken ¶
func ResolveToken(tokenString string) (int, *MemberShip, error)
func (*MemberShip) CheckAdmin ¶
func (*MemberShip) CheckCreater ¶
func (m *MemberShip) CheckCreater(table string, id int64) (isCreater bool, err error)
func (*MemberShip) CheckOwner ¶
func (*MemberShip) CheckPermission ¶
func (m *MemberShip) CheckPermission(reqRole model.Role) (permit bool)
func (*MemberShip) GetWhere ¶
func (m *MemberShip) GetWhere() (where string)
func (*MemberShip) SetContext ¶
func (m *MemberShip) SetContext(ctx context.Context) context.Context
type NetworkLink ¶
type NetworkRoute ¶
type OpenshiftAdmin ¶
type OpenshiftAdmin struct{}
func (*OpenshiftAdmin) Delete ¶
func (a *OpenshiftAdmin) Delete(ctx context.Context, id int64) (err error)
type OpenshiftView ¶
type OpenshiftView struct{}
func (*OpenshiftView) Create ¶
func (v *OpenshiftView) Create(c *macaron.Context, store session.Store)
func (*OpenshiftView) Launch ¶
func (v *OpenshiftView) Launch(c *macaron.Context, store session.Store)
type PortmapAdmin ¶
type PortmapAdmin struct{}
type RegistryAdmin ¶
type RegistryAdmin struct{}
func (*RegistryAdmin) Delete ¶
func (a *RegistryAdmin) Delete(id int64) (err error)
type RegistryView ¶
type RegistryView struct{}
func (*RegistryView) Create ¶
func (v *RegistryView) Create(c *macaron.Context, store session.Store)
type ResourceData ¶
type ResourceData struct { Title string `json:"title"` CpuUsed int64 `json:"cpu_used"` CpuAvail int64 `json:"cpu_avail"` MemUsed int64 `json:"mem_used"` MemAvail int64 `json:"mem_avail"` DiskUsed int64 `json:"disk_used"` DiskAvail int64 `json:"disk_avail"` VolumeUsed int64 `json:"volume_used"` VolumeAvail int64 `json:"volume_avail"` PubipUsed int64 `json:"pubip_used"` PubipAvail int64 `json:"pubip_avail"` PrvipUsed int64 `json:"prvip_used"` PrvipAvail int64 `json:"prvip_avail"` }
type SecgroupAdmin ¶
type SecgroupAdmin struct{}
func (*SecgroupAdmin) Create ¶
func (a *SecgroupAdmin) Create(ctx context.Context, name string, isDefault bool, owner int64) (secgroup *model.SecurityGroup, err error)
func (*SecgroupAdmin) Delete ¶
func (a *SecgroupAdmin) Delete(id int64) (err error)
func (*SecgroupAdmin) List ¶
func (a *SecgroupAdmin) List(ctx context.Context, offset, limit int64, order, query string) (total int64, secgroups []*model.SecurityGroup, err error)
func (*SecgroupAdmin) Switch ¶
func (a *SecgroupAdmin) Switch(ctx context.Context, newSg *model.SecurityGroup, store session.Store) (err error)
type SecgroupView ¶
type SecgroupView struct{}
func (*SecgroupView) Create ¶
func (v *SecgroupView) Create(c *macaron.Context, store session.Store)
type SecruleAdmin ¶
type SecruleAdmin struct{}
func (*SecruleAdmin) ApplySecgroup ¶
func (a *SecruleAdmin) ApplySecgroup(ctx context.Context, secgroup *model.SecurityGroup, ruleID int64) (err error)
func (*SecruleAdmin) Create ¶
func (a *SecruleAdmin) Create(ctx context.Context, sgID, owner int64, remoteIp, direction, protocol string, portMin, portMax int) (secrule *model.SecurityRule, err error)
func (*SecruleAdmin) Delete ¶
func (a *SecruleAdmin) Delete(ctx context.Context, sgID, id int64) (err error)
type SecurityData ¶
type StaticRoute ¶
type SubnetAdmin ¶
type SubnetAdmin struct{}
func (*SubnetAdmin) Delete ¶
func (a *SubnetAdmin) Delete(ctx context.Context, id int64) (err error)
type SubnetIface ¶
type SubnetIface struct { Address string `json:"ip_address"` MacAddr string `json:"mac_address"` Vni int64 `json:"vni"` Routes []*StaticRoute `json:"routes,omitempty"` }
type TokenClaim ¶
type UserAdmin ¶
type UserAdmin struct{}
func (*UserAdmin) AccessToken ¶
func (*UserAdmin) CompareHashAndPassword ¶
CompareHashAndPassword is slow by design, do not call it too offen.
func (*UserAdmin) GenerateFromPassword ¶
GenerateFromPassword is slow by design, do not call it too offen.
type VolumeAdmin ¶
type VolumeAdmin struct{}
func (*VolumeAdmin) Delete ¶
func (a *VolumeAdmin) Delete(ctx context.Context, id int64) (err error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.