model

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

@Time : 2019-08-27 14:57 @Author : zr

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Role

type Role struct {
	Name        string
	State       int16
	Description string
	EditTime    time.Time
	CreateTime  time.Time
	Services    []*Service
	Storage     Storage
}

func (*Role) Save

func (r *Role) Save() error

type Service

type Service struct {
	Name        string
	SupService  string
	SubService  map[string]*Service
	Description string
	CreateTime  time.Time
	EditTime    time.Time
	Roles       []*Role
	Storage     Storage
}

func (*Service) AddRoles

func (s *Service) AddRoles(roles ...*Role) (err error)

func (*Service) NewSubService

func (s *Service) NewSubService(name string) *Service

func (*Service) Save

func (s *Service) Save() error

type Storage

type Storage interface {
	Sync() (serviceTree map[string]*Service, roles []*Role, err error)
	SaveRole(role *Role) error
	SaveService(service *Service) error
	SaveRelation(service *Service, role ...*Role) error
}

Jump to

Keyboard shortcuts

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