service

package
v1.4.0-beta Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApprovalType

type ApprovalType string
const (
	ApprovalTypeAuto   ApprovalType = "auto"
	ApprovalTypeManual ApprovalType = "manual"
)

func ToApprovalType

func ToApprovalType(s int) ApprovalType

func (ApprovalType) Int

func (s ApprovalType) Int() int

func (ApprovalType) String

func (s ApprovalType) String() string

type Create

type Create struct {
	Id               string
	Name             string
	Description      string
	Team             string
	Prefix           string
	ServiceType      ServiceType
	Kind             Kind
	Catalogue        string
	AdditionalConfig map[string]string
	ApprovalType     ApprovalType
	AsServer         bool
	AsApp            bool
}

type CreateTag

type CreateTag struct {
	Tid string
	Sid string
}

type Edit

type Edit struct {
	Name             *string
	Description      *string
	ServiceType      *ServiceType
	Kind             *Kind
	Catalogue        *string
	AdditionalConfig *map[string]string
	ApprovalType     *ApprovalType
}

type IServiceService

type IServiceService interface {
	universally.IServiceGet[Service]
	universally.IServiceDelete
	universally.IServiceCreate[Create]
	universally.IServiceEdit[Edit]
	ServiceCountByTeam(ctx context.Context, teamId ...string) (map[string]int64, error)
	AppCountByTeam(ctx context.Context, teamId ...string) (map[string]int64, error)
	SearchPublicServices(ctx context.Context, keyword string) ([]*Service, error)
	Check(ctx context.Context, id string, rule map[string]bool) (*Service, error)
	ServiceList(ctx context.Context, serviceIds ...string) ([]*Service, error)
	ServiceListByKind(ctx context.Context, kind Kind, serviceIds ...string) ([]*Service, error)
	AppList(ctx context.Context, appIds ...string) ([]*Service, error)
}

type Kind

type Kind string
const (
	RestService Kind = "rest"
	AIService   Kind = "ai"
)

func ToServiceKind

func ToServiceKind(s int) Kind

func (Kind) Int

func (s Kind) Int() int

func (Kind) String

func (s Kind) String() string

type Service

type Service struct {
	Id               string
	Name             string
	Description      string
	Team             string
	Prefix           string
	ServiceType      ServiceType
	Kind             Kind
	Catalogue        string
	AdditionalConfig map[string]string
	AsServer         bool
	AsApp            bool
	ApprovalType     ApprovalType
	CreateTime       time.Time
	UpdateTime       time.Time
}

func FromEntity

func FromEntity(e *service.Service) *Service

type ServiceType

type ServiceType string
const (
	InnerService   ServiceType = "inner"
	PublicService  ServiceType = "public"
	UnknownService ServiceType = "unknown"
)

func ToServiceType

func ToServiceType(s int) ServiceType

func (ServiceType) Int

func (s ServiceType) Int() int

func (ServiceType) String

func (s ServiceType) String() string

Jump to

Keyboard shortcuts

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