sdk

package module
v0.0.0-...-094b1a8 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 9 Imported by: 0

README

This repository is work in progress v0 Not stable to use anywhere

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOptions

type CreateOptions struct {
	// contains filtered or unexported fields
}

type CreateOptionsFn

type CreateOptionsFn func(opt *CreateOptions)

func WithOutputColors

func WithOutputColors(outputColors bool) CreateOptionsFn

WithOutputColors can be used for override default=true mode (ansi)

true  = ansi  (use colors)
false = ascii (only plain text)

func WithSkipMissUse

func WithSkipMissUse(skipMissUse bool) CreateOptionsFn

WithSkipMissUse if set to true: - will skip not critical notices in config validation

func WithUsedContext

func WithUsedContext(usedContext arch.UsedContext) CreateOptionsFn

WithUsedContext sets the logic context in which the SDK runs In 99.9% you don`t need set this option

type SDK

type SDK struct {
	// contains filtered or unexported fields
}

SDK is root type for any other interaction with SDK and all functions.

func NewSDK

func NewSDK(projectDirectory arch.PathAbsolute, opts ...CreateOptionsFn) (*SDK, error)

NewSDK Creates new SDK library for specified project you need pass absolute projectDirectory where your GO project (go.mod) is located

Next steps: - call SDK.Spec().FromXXX(..) to get or define "Arch specification" - call SDK.Mapping($spec) to run "mapping" command - call SDK.Check($spec) to run "check" command

func (*SDK) Assert

func (sdk *SDK) Assert(t *testing.T, result check.Out)

func (*SDK) Check

func (sdk *SDK) Check(spec arch.Spec, in check.In) (check.Out, error)

Check will run all configured arch linters and return all found notices

func (*SDK) Mapping

func (sdk *SDK) Mapping(spec arch.Spec, in mapping.In) (mapping.Out, error)

Mapping will return mapping information between project GO packages and components defined in spec, it useful for debugging purpose (ex: find out how glob path's (ex: "domain/*/repos/**") cover your go files

func (*SDK) Spec

func (sdk *SDK) Spec() *definition.Definition

Spec returns config builder / fetcher Next you can use FromXXX method on it, to get proper Arch specification to work with.

Jump to

Keyboard shortcuts

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